Search code examples
gridrecordresetgxttogglebutton

Setting Record Data resets ToggleButton


I am facing a strange problem. I have created a normal ext-gwt grid with two columns. One column displays a number and the other renders a ToggleButton. As soon as the ToggleButton gets pressed a small window appears with: 1- a textfield (to enter a number), 2- an ok button. When the ok button is pressed the column containing the number should change it's value to the value given in the small window's textfield. This is the final picture I want to have. Easy! right?

The problem comes now. This is what is executed when the ok button is pressed in order to change the value in the column:

Integer value = new Integer(10);
Record record = store.getRecord(bean);
record.set("employeeNumber", value);

Although the value is actually changed using this code, it makes something weird. The ToggleButton remains in the "un-pressed" state whenever this code is executed. If I remove the last line, the ToggleButton functions normally again (gets pressed).

Any idea how to solve the problem of the ToggleButton?

Thank you


Solution

  • So you want the toggle button to change state after setting the value, right? How do you get the toggle button into the grid? I assume by using a custom widget renderer? In this case the render(..) method will be called more than once, returning a fresh and un-toggled button each time which will be displayed...

    Maybe you could post some more code...?