I've looked around for this on the group and on the web and I'm
surprised that I've not been able to find any information on this.

I currently have a state in my app where there is user-entered
information, and I'd like to ask the user before navigating to a state
that loses that information.  The WindowCloseListener works just fine
for cases where the page unloads (navigating to a new page, closing
the browser window, etc.) but the GWT app's internal history state
does not unload the page, so naturally the Listener doesn't fire its
events.

The problem is that this leaves no elegant way to deal with this
situation in the gwt history management.   There really isn't a way to
handle the situation in onHistoryChanged because by the time we get
there, the history stack (and the url/history token) have already
changed.  Ignoring the change can leave the stack in a bit of a
mangled state, navigation-wise.  There isn't really a
beforeHistoryChanged event I can hook into to cancel the action and
prevent the change in history state, and I'm not sure it makes much
sense to do.

I can't think of anyway to deal with this situation other than
creating a bunch of fake hyperlinks (labels that look like links) with
click listeners that programatically change the history state using
History.newItem(), but that seems to just take away from the elegance
of the Hyperlink class.

Does anyone have any thoughts on this?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to