How to prevent GXT Dialog from closing on failed validation
I have a simple GXT dialog window with 2 buttons, "OK" and "Cancel". When
the OK button is pressed I validate that fields are not empty and I want
to prevent the dialog window from been closed but I haven't been able to
figure out how. Here's what I have
super.getButtonById(Dialog.OK).addSelectionListener(new
SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if(netScanName.getValue() == null) {
Util.alert("All fields are required!");
return;
}
}
});
The event properly fires because i get my window alert but then the dialog
continues to close any way. Any suggestions?
No comments:
Post a Comment