java - How to prevent GXT Dialog from closing on failed validation -
i have simple gxt dialog window 2 buttons, "ok" , "cancel". when ok button pressed validate fields not empty , want prevent dialog window been closed haven't been able figure out how. here's have
super.getbuttonbyid(dialog.ok).addselectionlistener(new selectionlistener<buttonevent>() { @override public void componentselected(buttonevent ce) { if(netscanname.getvalue() == null) { util.alert("all fields required!"); return; } } });
the event fires because window alert dialog continues close way. suggestions?
are using gxt 3.0.x?
using gxt 3.0.x solve request setting
dialog.sethideonbuttonclick(false);
to manage closing of dialogbox use code:
dialog.getbuttonbyid(predefinedbutton.ok.name()).addselecthandler(new selecthandler() { @override public void onselect(selectevent event) { if (netscanname.getvalue() == null) { util.alert("all fields required!"); } else { dialog.hide(); } } });
don't know if code work earlier versons of gxt.
Comments
Post a Comment