You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Marieke Vandamme (JIRA)" <ji...@apache.org> on 2010/11/03 15:28:26 UTC

[jira] Created: (WICKET-3144) Extra client-side scripting before closing modalwindow

Extra client-side scripting before closing modalwindow
------------------------------------------------------

                 Key: WICKET-3144
                 URL: https://issues.apache.org/jira/browse/WICKET-3144
             Project: Wicket
          Issue Type: New Feature
          Components: wicket-extensions
            Reporter: Marieke Vandamme


I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
Thanks, Marieke Vandamme

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


[jira] Closed: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Jeremy Thomerson closed WICKET-3144.
------------------------------------

    Resolution: Invalid

sorry, should've been invalid rather than won't fix

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Marieke Vandamme
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Commented: (WICKET-3144) Extra client-side scripting before closing modalwindow

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929309#action_12929309 ] 

Hudson commented on WICKET-3144:
--------------------------------

Integrated in Apache Wicket 1.5.x #493 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.5.x/493/])
    

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>    Affects Versions: 1.4.12, 1.5-M2.1
>            Reporter: Marieke Vandamme
>            Assignee: Martin Grigorov
>             Fix For: 1.4.14, 1.5-M4
>
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Commented: (WICKET-3144) Extra client-side scripting before closing modalwindow

Posted by "Marieke Vandamme (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928148#action_12928148 ] 

Marieke Vandamme commented on WICKET-3144:
------------------------------------------

Jeremy, 

I posted this on mailinglist, but just got a workaround:
http://apache-wicket.1842946.n4.nabble.com/Modalwindow-with-confirm-box-on-close-button-td3014935.html

I don't know how overriding the close function can solve my problem. Maybe I can explain better with an example of something we use very often:
  WebMarkupContainer btnSubmit = new WebMarkupContainer("btnSubmit");
  btnSubmit.add(new AjaxFormSubmitBehavior("onclick"){
    protected void onSubmit(AjaxRequestTarget target) {
    }

    protected CharSequence getEventHandler() {
      String confirmText = "...";
      return "if(!confirm('" + confirmText + "')) return false;" + super.getEventHandler();
    }
  });

When overriding the close function or the closeButtonCallback, it's to late. My confirmbox should be just before going back to the server. Or am I missing something? 

Many thanks. Kind Regards, Marieke Vandamme


> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Marieke Vandamme
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Reopened: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Martin Grigorov reopened WICKET-3144:
-------------------------------------

      Assignee: Martin Grigorov

My quick investigation shows that ModalWIndow#init(){ add(new CloseButtonBehavior()); } should be made extendable: newCloseButtonBehavior() so the user app can provide custom IAjaxCallDecorator

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Marieke Vandamme
>            Assignee: Martin Grigorov
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Resolved: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Martin Grigorov resolved WICKET-3144.
-------------------------------------

    Resolution: Fixed

Improved with r1032118 in trunk and 1032124 in 1.4.x.

To do what you need:

{code}
new ModalWindow("modal")
{

	/**
	 * @see org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow#newCloseButtonBehavior()
	 */
	@Override
	protected CloseButtonBehavior newCloseButtonBehavior()
	{
		return new CloseButtonBehavior()
		{

			/**
			 * @see org.apache.wicket.extensions.ajax.markup.html.modal.ModalWindow.CloseButtonBehavior#getAjaxCallDecorator()
			 */
			@Override
			protected IAjaxCallDecorator getAjaxCallDecorator()
			{
				return new AjaxPreprocessingCallDecorator(super.getAjaxCallDecorator())
				{
					@Override
					public CharSequence preDecorateScript(CharSequence script)
					{
						return "console.log('Test'); " + script;
					}
				};
			}

		};
	}
}
{code}

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>    Affects Versions: 1.4.12, 1.5-M2.1
>            Reporter: Marieke Vandamme
>            Assignee: Martin Grigorov
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Updated: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Martin Grigorov updated WICKET-3144:
------------------------------------

    Affects Version/s: 1.4.12
                       1.5-M2.1
        Fix Version/s: 1.5-M4
                       1.4.14

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>    Affects Versions: 1.4.12, 1.5-M2.1
>            Reporter: Marieke Vandamme
>            Assignee: Martin Grigorov
>             Fix For: 1.4.14, 1.5-M4
>
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Closed: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Jeremy Thomerson closed WICKET-3144.
------------------------------------

    Resolution: Won't Fix

This isn't a bug.  You can already do this.  The close button is generated and called in JS.  Just intercept that function call to the JS close function, do your own thing, then delegate to the original close function.

I think the function you want to override (and then delegate to) is: Wicket.Window.close - but I'm not 100% sure.  

If, in general, you need advice on how to do something, or think that you can't, you should ask on the mailing (dev@wicket.apache.org) list first.

> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Marieke Vandamme
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Reopened: (WICKET-3144) Extra client-side scripting before closing modalwindow

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

Jeremy Thomerson reopened WICKET-3144:
--------------------------------------


> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>            Reporter: Marieke Vandamme
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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


[jira] Commented: (WICKET-3144) Extra client-side scripting before closing modalwindow

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-3144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12929129#action_12929129 ] 

Hudson commented on WICKET-3144:
--------------------------------

Integrated in Apache Wicket 1.4.x #252 (See [https://hudson.apache.org/hudson/job/Apache%20Wicket%201.4.x/252/])
    WICKET-3144 Extra client-side scripting before closing modalwindow

Add the possibility to modify the javascript used for closing the modal window (i.e. provide custom IAjaxCallDecorator for CloseButtonBehavior)

merge r1032118 from trunk


> Extra client-side scripting before closing modalwindow
> ------------------------------------------------------
>
>                 Key: WICKET-3144
>                 URL: https://issues.apache.org/jira/browse/WICKET-3144
>             Project: Wicket
>          Issue Type: New Feature
>          Components: wicket-extensions
>    Affects Versions: 1.4.12, 1.5-M2.1
>            Reporter: Marieke Vandamme
>            Assignee: Martin Grigorov
>             Fix For: 1.4.14, 1.5-M4
>
>
> I would like to add extra client-side scripting that is executed before the modalwindow is closed. 
> Now you can already add server-side with overriding onCloseButtonClicked, but then the window is already closing. 
> I need this because I want to show a confirm-box to the user, so that he can confirm that he wants to close the window.
> Thanks, Marieke Vandamme

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