gwt - How to catch user leaving a page and cancelling it -
When a user leaves GWT app, I want to open a confirmation dialog and provide alternatives to them I want to confirm, i.e. confirm ("do you really want to leave this page", "yes", "no").
I know how to create dialblocks :)
The question is, how can I catch a user leaving the page and cancel it?
Daniel
Call, and pass it to a callback that calls to the window Does. Closing Event (such as:
Window.and Window HostingHandler (New Window ClosingHandler) {Public Wide On Wide Cloaking (Closing Event Closing Event) {closingEvent.setMessage ("Do you really want to leave the page? Are? ");}});
(I've added links to GWT 2.0 docs, to change GWT 1.6 / 1.7 docs to 2.0 to 1.6 in those URLs.)
Note By doing this, you do not need to create the dialog box itself.
Comments
Post a Comment