Ok. But this makes an extra roundtrip to the server.. is that what you want?

On Wed, Apr 20, 2016 at 3:16 PM, Lorne Malvo <caffeineindu...@gmail.com>
wrote:

> Ernesto thanks for the help.
>
> I made it work by using an AjaxEventBehavior and adding it directly to the
> page, like so:
>
>
> AjaxEventBehavior event = new AjaxEventBehavior("beforeunload") {
>     @Override
>     protected void onEvent(final AjaxRequestTarget target) {
>         // do stuff here
>         target.appendJavaScript("alert('are you sure want to navigate
> away?');");
>     }
> }
> add(event);
>
> --
> View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/Wicket-way-to-show-a-Are-you-sure-you-want-to-navigate-away-page-tp4674323p4674333.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
>
>


-- 
Regards - Ernesto Reinaldo Barreiro

Reply via email to