avb
19 Oct 2008, 1:51 AM
Hello!
I faced with the following problem:
1. I have a FormPanel with a ButtonBar. By default, all fields in this panel are disabled and ButtonBar contains two buttons: OK, EDIT. If a person clicks the EDIT button, all fields should become enabled and ButtonBar should contain other buttons: SAVE, CANCEL. The problem is that new buttons don't appear. I do the following:
ButtonBar bar = formPanel.getButtonBar();
buttonBar.removeAll();
buttonBar.add(saveButton);
buttonBar.add(cancelButton);
formPanel.layout();
However, all buttons are disappeared and new are not shown.
Similarly, I can't add new button to the existing ButtonBar.
Could you please help me to solve it? Now I use silly workaround: set my "edit" flag to true, remove and add this FormPanel, rendering it with proper buttons! It is rediculous! :)
Thank you!
I faced with the following problem:
1. I have a FormPanel with a ButtonBar. By default, all fields in this panel are disabled and ButtonBar contains two buttons: OK, EDIT. If a person clicks the EDIT button, all fields should become enabled and ButtonBar should contain other buttons: SAVE, CANCEL. The problem is that new buttons don't appear. I do the following:
ButtonBar bar = formPanel.getButtonBar();
buttonBar.removeAll();
buttonBar.add(saveButton);
buttonBar.add(cancelButton);
formPanel.layout();
However, all buttons are disappeared and new are not shown.
Similarly, I can't add new button to the existing ButtonBar.
Could you please help me to solve it? Now I use silly workaround: set my "edit" flag to true, remove and add this FormPanel, rendering it with proper buttons! It is rediculous! :)
Thank you!