Disabling Modal Unload Confirmation

2008-02-14 Thread UPBrandon

I have a page that uses ModalWindows and I would like to disable the
JavaScript confirmation that is displayed when you try to leave the page
while a modal window is open.  As recommended by developers here, I added
Wicket.Window.unloadConfirmation = false; in my page header to disable
those confirmations.  However, when the page loads, the browser gives me an
error say that Wicket.Window doesn't have any properties.  As you might
expect, the confirmation dialog is not not disabled.

Looking at the source for my page, it looks like my code, which was declared
inside of a wicket:head tag, is called before Wicket's modal.js.  I assume
that including modal.js before Wicket.Window.unloadConfirmation = false
would fix the problem but I'm not sure how to do that. Does anyone know of a
way to fix this?

-Brandon
-- 
View this message in context: 
http://www.nabble.com/Disabling-Modal-Unload-Confirmation-tp15491041p15491041.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Disabling Modal Unload Confirmation

2008-02-14 Thread Mats Norén

UPBrandon wrote:

I have a page that uses ModalWindows and I would like to disable the
JavaScript confirmation that is displayed when you try to leave the page
while a modal window is open.  As recommended by developers here, I added
Wicket.Window.unloadConfirmation = false; in my page header to disable
those confirmations.  However, when the page loads, the browser gives me an
error say that Wicket.Window doesn't have any properties.  As you might
expect, the confirmation dialog is not not disabled.

Looking at the source for my page, it looks like my code, which was declared
inside of a wicket:head tag, is called before Wicket's modal.js.  I assume
that including modal.js before Wicket.Window.unloadConfirmation = false
would fix the problem but I'm not sure how to do that. Does anyone know of a
way to fix this?


You could try to add the Wicket.Window.unloadConfirmation = false in 
the a IHeaderContributor and use response.addOnDomReadyJavaScript(...).


That way the script is executed when everything is ready.

/Mats



-Brandon



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]