0

Prevent closing of dialog

asked 2011-06-17 05:15:12 +0800

imbaspam gravatar image imbaspam
72

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.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2011-06-21 22:52:23 +0800

mjablonski gravatar image mjablonski
1284 3 5
http://www.jease.org/

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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-06-17 05:15:12 +0800

Seen: 344 times

Last updated: Jun 21 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More