How to implement "Are you sure you want to leave?"

31 views
Skip to first unread message

sib

unread,
Aug 24, 2011, 11:50:54 AM8/24/11
to Google Web Toolkit
Hi All,

I've been trying to emulate the "Are you sure you want to leave"
prompt before someone leaves a page without saving their data. My
problem is that when i get the ValueChangeEvent the token has already
been pushed into the history so when user selects "stay on the page"
even if i ignore the event and don't change the page, the value in the
browser history has already changed!! (So even though user chose to
stay it shows the new token in address bar)

Is there a way to intercept the event before it's pushed to the
history stack? or somehow rewind the stack? or a common trick used for
this purpose?

Thanks in advance
Sina

Thomas Broyer

unread,
Aug 24, 2011, 12:05:05 PM8/24/11
to google-we...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages