I was required to put a "Done" button in a GWT Composite (despite already having the close icon), it should simply close the window upon clicking. Unfortunately, I can't find a .close()
method to implement it. How can it be done?
I have a UserDialog class that contains a Composite component, which I named UserComposite. UserDialog extends to CustomDialogBox, which extends to DialogBox class:
public class UserDialog extends CustomDialogBox {
private UserComposite c = new UserComposite();
// more codes here
private FlowPanel getFlowPanel() {
if (p instanceof Panel && c instanceof Composite) {
p.setSize(WIDTH, HEIGHT);
p.add(c);
}
return p;
}
}
and then this is my UserComposite
public class UserComposite extends Composite {
// codes here
@UiHandler("doneButton")
void onDoneButtonClick(ClickEvent event) {
this.removeFromParent();
}
}
I tried removeFromParent() but the UserComposite was only removed from parent which resulted to an empty DialogBox.