I'm not sure this will work.
First the Ajax call should be synchronous otherwise onbeforeunload will
continue and unload the DOM/page. Second the returned ajax response is
executed again in asynchronous way - using function chaining, and I think
this will also "release the lock".
Canceling the onbeforeunload event earlier (event.returnValue = false) and
then using normal asych Ajax to show the modal will do it halfway - there is
no way to continue to the original destination after the user say "Yes,
close"

On Fri, May 13, 2011 at 8:51 AM, Hielke Hoeve <hielke.ho...@topicus.nl>wrote:

> You could use an ajax callback to wicket in the onbeforeunload and do
> something serverside but showing a modalwindow is probably impossible as
> the onbeforeunload will continue after the ajax call is done...
>
> Hielke
>
> -----Original Message-----
> From: Andrea Del Bene [mailto:adelb...@ciseonweb.it]
> Sent: donderdag 12 mei 2011 12:04
> To: users@wicket.apache.org
> Subject: Re: warn on exit from browser
>
> So far as i know Wicket can't  help you that much since this is a "pure"
>
> client side problem.
> > Thank you andrea, but i already managed to use javascript to show a
> > confirm dialog.
> >
> > What I would like to know is if it is possible to change the default
> > behavior of the browser and to show a wicket popup instead of the
> > confirm dialog?
> >
> > --
> > View this message in context:
> > http://apache-wicket.1842946.n4.nabble.com/warn-on-exit-from-browser-t
> > p3516569p3516849.html Sent from the Users forum mailing list archive
> > at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> > For additional commands, e-mail: users-h...@wicket.apache.org
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>


-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com <http://jweekend.com/>

Reply via email to