Hi there,
I’m running into some interoperability issues while trying to integrate GWT widgets with SmartGWT layouts. One of which is GWT widget not showing after it was removed and then added back to the Layout. I tried the same for SmartGWT widget and it worked perfectly.
Here is the code to illustrate this issue:
public void onModuleLoad() {
final VLayout layout = new VLayout();
layout.setWidth100();
layout.setHeight100();
final WidgetCanvas hello = new WidgetCanvas(new com.google.gwt.user.client.ui.Label("Hello"));
//final Label hello = new Label("Hello");
final Canvas add = new IButton("Add");
final Canvas remove = new IButton("Remove");
remove.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
// 1. click on the remove button to remove hello label
layout.removeMember(hello);
remove.disable();
add.enable();
}
});
add.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
// 2. add the label back but this time it doesn't show up
layout.addMember(hello, 0);
add.disable();
remove.enable();
}
});
add.disable();
layout.addMember(hello);
layout.addMember(remove);
layout.addMember(add);
layout.draw();
}
Any help would be much appreciated.
Thanks in advanced.
–Kevin