You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Michał Letyński (JIRA)" <ji...@apache.org> on 2010/02/22 13:20:28 UTC

[jira] Created: (WICKET-2755) unloadConfirmation should be configurable from ModalWindow

unloadConfirmation should be configurable from ModalWindow
----------------------------------------------------------

                 Key: WICKET-2755
                 URL: https://issues.apache.org/jira/browse/WICKET-2755
             Project: Wicket
          Issue Type: Improvement
          Components: wicket-extensions
    Affects Versions: 1.4.6
            Reporter: Michał Letyński


Hi.
After refreshing page with modal window on it i get alert:
"Reloading this page will cause the modal window to disappear."
Its from modal.js

       if (Wicket.Window.unloadConfirmation == true) {
            // new beforeunload handler - ask user before reloading window
            window.onbeforeunload = function() {           
                return "Reloading this page will cause the modal window to disappear.";
            }               
        }

unloadConfirmation is always true.
Can you make it configurable ? For e.g throught setting's in ModalWindow.class ? Because now i need to override onbeforeunload  withy empty body function


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (WICKET-2755) unloadConfirmation should be configurable from ModalWindow

Posted by "Michał Letyński (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836625#action_12836625 ] 

Michał Letyński commented on WICKET-2755:
-----------------------------------------

Proposed solution:
In modal.js instead of
if (Wicket.Window.unloadConfirmation == true)  
use 
(this.settings.unloadConfirmation == true) 

In ModalWindow in getWindowOpenJavascript() method
add
appendAssignment(buffer, "settings.unloadConfirmation ", getUnloadConfirmation());

getUnloadConfirmation() simple getter, true for default

> unloadConfirmation should be configurable from ModalWindow
> ----------------------------------------------------------
>
>                 Key: WICKET-2755
>                 URL: https://issues.apache.org/jira/browse/WICKET-2755
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.6
>            Reporter: Michał Letyński
>
> Hi.
> After refreshing page with modal window on it i get alert:
> "Reloading this page will cause the modal window to disappear."
> Its from modal.js
>        if (Wicket.Window.unloadConfirmation == true) {
>             // new beforeunload handler - ask user before reloading window
>             window.onbeforeunload = function() {           
>                 return "Reloading this page will cause the modal window to disappear.";
>             }               
>         }
> unloadConfirmation is always true.
> Can you make it configurable ? For e.g throught setting's in ModalWindow.class ? Because now i need to override onbeforeunload  withy empty body function

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WICKET-2755) unloadConfirmation should be configurable from ModalWindow

Posted by "Igor Vaynberg (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-2755?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Igor Vaynberg resolved WICKET-2755.
-----------------------------------

    Resolution: Won't Fix
      Assignee: Igor Vaynberg

this setting is global for all modal windows and so tweaking it from the modalwindow class doesnt really make sense. a cleaner solution then overriding the method with an empty function is to use iheadercontributor and output a bit of js into the page "Wicket.Window.unloadConfirmation = false;"

> unloadConfirmation should be configurable from ModalWindow
> ----------------------------------------------------------
>
>                 Key: WICKET-2755
>                 URL: https://issues.apache.org/jira/browse/WICKET-2755
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket-extensions
>    Affects Versions: 1.4.6
>            Reporter: Michał Letyński
>            Assignee: Igor Vaynberg
>
> Hi.
> After refreshing page with modal window on it i get alert:
> "Reloading this page will cause the modal window to disappear."
> Its from modal.js
>        if (Wicket.Window.unloadConfirmation == true) {
>             // new beforeunload handler - ask user before reloading window
>             window.onbeforeunload = function() {           
>                 return "Reloading this page will cause the modal window to disappear.";
>             }               
>         }
> unloadConfirmation is always true.
> Can you make it configurable ? For e.g throught setting's in ModalWindow.class ? Because now i need to override onbeforeunload  withy empty body function

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.