Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
In this case yes, I do have to execute some logic server side anyway... Thanks again. -- 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-tp4674323p4674339.html Sent from the Users forum mailing list

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Ernesto Reinaldo Barreiro
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 wrote: > Ernesto thanks for the help. > > I made it work by using an AjaxEventBehavior and adding it directly to the > page, like so: > > >

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Ernesto Reinaldo Barreiro
No idea... You add this with a panel that is updated via AJAX? I will try it with simple example. On Wed, Apr 20, 2016 at 2:35 PM, Lorne Malvo wrote: > Hi Ernesto, > > thanks - but that didn't quite work. Wicket Ajax Debug tells me "window" is > not in the DOM. > >

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
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

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Martin Grigorov
Hi, Please show us your code. Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Wed, Apr 20, 2016 at 2:35 PM, Lorne Malvo wrote: > Hi Ernesto, > > thanks - but that didn't quite work. Wicket Ajax Debug tells me "window" is > not in the

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Hi Ernesto, thanks - but that didn't quite work. Wicket Ajax Debug tells me "window" is not in the DOM. Any other ideas? Thanks! -- View this message in context:

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Ernesto Reinaldo Barreiro
Did it worked? On Wed, Apr 20, 2016 at 2:15 PM, Ernesto Reinaldo Barreiro < reier...@gmail.com> wrote: > Just guessing > > OnEventHeaderItem forScript("window", "*beforeunload*", "*function*() { > *return > '**Sure do you want to leave us?'*; }"); > > On Wed, Apr 20, 2016 at 1:31 PM, Lorne

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Ernesto Reinaldo Barreiro
Just guessing OnEventHeaderItem forScript("window", "*beforeunload*", "*function*() { *return '**Sure do you want to leave us?'*; }"); On Wed, Apr 20, 2016 at 1:31 PM, Lorne Malvo wrote: > Thanks Ernesto. > > I tried using OnEventHeaderItem but can't quite get it to

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Thanks Ernesto. I tried using OnEventHeaderItem but can't quite get it to work. What would I use as a target? Thanks! -- 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-tp4674323p4674326.html Sent from

Re: "Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Ernesto Reinaldo Barreiro
Modal window does this like *// Wicket.Window.unloadConfirmation is deprecated but we need to check it // for backward compatibility. Remove it after Wicket 7.0 **if *(*this*.settings.unloadConfirmation && Wicket.Window.unloadConfirmation) { Wicket.Event.add(window,

"Wicket way" to show a "Are you sure you want to navigate away" page?

2016-04-20 Thread Lorne Malvo
Does Wicket have any built in support for showing a "Are you sure you want to navigate away from this page" message when the user navigates away from the page? What would be the simplest way to detect when a user is trying to navigate away from a page, execute some Java code, and then show a "Are