-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I created an dialog window in ZK which shows above whole browser (using doModal on window class object). Now in upper right-corner there is an 'X' that close dialog. Using onClose$win(Event ent) I add event handler that executes when user clicks on X. I want to disable that window closes.
Here is a scenario: When user clicks X it pops up another popup where user should confirm closing of dialog (Do you wish to exit without saving etc...). If user decides not to quit then dialog should remain on screen. So is there a way to prevent closing of window when onClose event is called?
Thanks.
Hi,
you'll have to stop the propagation of the event in the onClose-handler of your window:
<window title="win" border="normal" width="200px" height="200px" closable="true"> <attribute name="onClose"><![CDATA[ event.stopPropagation(); Messagebox.show("Are you sure to close the window?", "Question", Messagebox.OK | Messagebox.CANCEL, Messagebox.QUESTION); ]]></attribute> </window>
Cheers, Maik
Asked: 2011-06-17 05:15:12 +0800
Seen: 344 times
Last updated: Jun 21 '11