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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to