You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jered Myers <je...@maplewoodsoftware.com> on 2012/02/01 01:55:13 UTC

Cannot detect ModalWindow cancel

I have a ModalWindow where I need to know if the user saved in the 
WindowClosedCallback or if they chose to click the X to close the 
window.  To do this in Wicket 1.4, I just set a variable on the page 
that the ModalWindow gets in the PageCreator and then check the variable 
in the WindowClosedCallback.  When I try this in Wicket 1.5 it doesn't 
work.  My variable retains the value I initialized it to and not the 
value I updated it to when I submitted the form on the ModalWindow 
page.  I am attaching a quickstart with the 1.5.4 version of Wicket.  
This is where the bug appears.  I updated the POM and a few files to 
test the same code with 1.4.19 and it works.

-- 
Jered Myers


RE: Cannot detect ModalWindow cancel - ModalX live demo

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
You can see a live demo of ModalX here:

http://demo.visualclassworks.com/modalx/

The section within the border demonstrates the use of ModalResult.

Regards,
Chris

>-----Original Message-----
>From: Jered Myers [mailto:jeredm@maplewoodsoftware.com]
>Sent: Thursday, 2 February 2012 7:04 AM
>To: users@wicket.apache.org
>Subject: Re: Cannot detect ModalWindow cancel
>
>Thanks for your help!  I will look into this.
>
>On 02/01/2012 11:34 AM, Chris Colman wrote:
>> In trying to solve your problem of determining how the user closed
the
>> form you might find the ModalX library in Wicketstuff useful.
>>
>> ModalX (Modal eXtensions) for Wicket (part of Wickestuff) provides a
>> generic modal panel, modal form which you can simply extend to build
>> your own modal panels, modal forms and when you use that you not only
>> have extremely easy modal construction but you also inherit some
>> standard behaviours that are common to modal windows in many
different
>> traditional OO UI frameworks.
>>
>> One of the standard behaviours available in many OO UI frameworks is
the
>> concept of a 'modal result' whereby the method by which the user
closed
>> the modal is stored and accessible in the form object after closure.
>>
>> In the ModalFormPanel the possible values returned by
getModalResult()
>> are:
>>
>> 	public static final int MR_OK = 1;
>> 	public static final int MR_CANCEL = 2;
>>
>> MR_CANCEL indicates the user closed the form using the cancel button
or
>> the X button in the top right corner. Both of these actions are
>> semantically the same.
>>
>> In MessageBox that extends MessageBox the following addition
>> getModalResults() values are:
>>
>> 	public static final int MR_YES = 3;
>> 	public static final int MR_NO = 4;
>>
>> because MessageBox can be constructed with a variety of
OK/Cancel/Yes/No
>> combinations in the control panel. These constants are MB_ not MR_
>> because they aren't modal results but rather specify the combination
of
>> buttons to display in the Message Box.
>>
>> 	public static final int MB_OK = 0;
>> 	public static final int MB_OK_CANCEL = 1;
>> 	public static final int MB_YES_NO = 2;
>> 	public static final int MB_YES_NO_CANCEL = 3;
>>
>>> -----Original Message-----
>>> From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
>>> Sent: Wednesday, 1 February 2012 8:49 PM
>>> To: users@wicket.apache.org
>>> Subject: Re: Cannot detect ModalWindow cancel
>>>
>>> Hi Jered,
>>>
>>> this is a known issue, you can find more informations here:
>>> https://issues.apache.org/jira/browse/WICKET-3809
>>>> I have a ModalWindow where I need to know if the user saved in the
>>>> WindowClosedCallback or if they chose to click the X to close the
>>>> window.  To do this in Wicket 1.4, I just set a variable on the
page
>>>> that the ModalWindow gets in the PageCreator and then check the
>>>> variable in the WindowClosedCallback.  When I try this in Wicket
1.5
>>>> it doesn't work.  My variable retains the value I initialized it to
>>>> and not the value I updated it to when I submitted the form on the
>>>> ModalWindow page.  I am attaching a quickstart with the 1.5.4
version
>>>> of Wicket.  This is where the bug appears.  I updated the POM and a
>>>> few files to test the same code with 1.4.19 and it works.
>>>>
>>>>
>>>>
>>>>
---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Cannot detect ModalWindow cancel

Posted by Jered Myers <je...@maplewoodsoftware.com>.
Thanks for your help!  I will look into this.

On 02/01/2012 11:34 AM, Chris Colman wrote:
> In trying to solve your problem of determining how the user closed the
> form you might find the ModalX library in Wicketstuff useful.
>
> ModalX (Modal eXtensions) for Wicket (part of Wickestuff) provides a
> generic modal panel, modal form which you can simply extend to build
> your own modal panels, modal forms and when you use that you not only
> have extremely easy modal construction but you also inherit some
> standard behaviours that are common to modal windows in many different
> traditional OO UI frameworks.
>
> One of the standard behaviours available in many OO UI frameworks is the
> concept of a 'modal result' whereby the method by which the user closed
> the modal is stored and accessible in the form object after closure.
>
> In the ModalFormPanel the possible values returned by getModalResult()
> are:
>
> 	public static final int MR_OK = 1;
> 	public static final int MR_CANCEL = 2;
>
> MR_CANCEL indicates the user closed the form using the cancel button or
> the X button in the top right corner. Both of these actions are
> semantically the same.
>
> In MessageBox that extends MessageBox the following addition
> getModalResults() values are:
>
> 	public static final int MR_YES = 3;
> 	public static final int MR_NO = 4;
>
> because MessageBox can be constructed with a variety of OK/Cancel/Yes/No
> combinations in the control panel. These constants are MB_ not MR_
> because they aren't modal results but rather specify the combination of
> buttons to display in the Message Box.
>
> 	public static final int MB_OK = 0;
> 	public static final int MB_OK_CANCEL = 1;
> 	public static final int MB_YES_NO = 2;
> 	public static final int MB_YES_NO_CANCEL = 3;
>
>> -----Original Message-----
>> From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
>> Sent: Wednesday, 1 February 2012 8:49 PM
>> To: users@wicket.apache.org
>> Subject: Re: Cannot detect ModalWindow cancel
>>
>> Hi Jered,
>>
>> this is a known issue, you can find more informations here:
>> https://issues.apache.org/jira/browse/WICKET-3809
>>> I have a ModalWindow where I need to know if the user saved in the
>>> WindowClosedCallback or if they chose to click the X to close the
>>> window.  To do this in Wicket 1.4, I just set a variable on the page
>>> that the ModalWindow gets in the PageCreator and then check the
>>> variable in the WindowClosedCallback.  When I try this in Wicket 1.5
>>> it doesn't work.  My variable retains the value I initialized it to
>>> and not the value I updated it to when I submitted the form on the
>>> ModalWindow page.  I am attaching a quickstart with the 1.5.4 version
>>> of Wicket.  This is where the bug appears.  I updated the POM and a
>>> few files to test the same code with 1.4.19 and it works.
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>>> For additional commands, e-mail: users-help@wicket.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


RE: Cannot detect ModalWindow cancel

Posted by Chris Colman <ch...@stepaheadsoftware.com>.
In trying to solve your problem of determining how the user closed the
form you might find the ModalX library in Wicketstuff useful.

ModalX (Modal eXtensions) for Wicket (part of Wickestuff) provides a
generic modal panel, modal form which you can simply extend to build
your own modal panels, modal forms and when you use that you not only
have extremely easy modal construction but you also inherit some
standard behaviours that are common to modal windows in many different
traditional OO UI frameworks.

One of the standard behaviours available in many OO UI frameworks is the
concept of a 'modal result' whereby the method by which the user closed
the modal is stored and accessible in the form object after closure.

In the ModalFormPanel the possible values returned by getModalResult()
are:

	public static final int MR_OK = 1;
	public static final int MR_CANCEL = 2;

MR_CANCEL indicates the user closed the form using the cancel button or
the X button in the top right corner. Both of these actions are
semantically the same.

In MessageBox that extends MessageBox the following addition
getModalResults() values are:

	public static final int MR_YES = 3;
	public static final int MR_NO = 4;

because MessageBox can be constructed with a variety of OK/Cancel/Yes/No
combinations in the control panel. These constants are MB_ not MR_
because they aren't modal results but rather specify the combination of
buttons to display in the Message Box.

	public static final int MB_OK = 0;
	public static final int MB_OK_CANCEL = 1;
	public static final int MB_YES_NO = 2;
	public static final int MB_YES_NO_CANCEL = 3;

>-----Original Message-----
>From: Andrea Del Bene [mailto:adelbene@ciseonweb.it]
>Sent: Wednesday, 1 February 2012 8:49 PM
>To: users@wicket.apache.org
>Subject: Re: Cannot detect ModalWindow cancel
>
>Hi Jered,
>
>this is a known issue, you can find more informations here:
>https://issues.apache.org/jira/browse/WICKET-3809
>> I have a ModalWindow where I need to know if the user saved in the
>> WindowClosedCallback or if they chose to click the X to close the
>> window.  To do this in Wicket 1.4, I just set a variable on the page
>> that the ModalWindow gets in the PageCreator and then check the
>> variable in the WindowClosedCallback.  When I try this in Wicket 1.5
>> it doesn't work.  My variable retains the value I initialized it to
>> and not the value I updated it to when I submitted the form on the
>> ModalWindow page.  I am attaching a quickstart with the 1.5.4 version
>> of Wicket.  This is where the bug appears.  I updated the POM and a
>> few files to test the same code with 1.4.19 and it works.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
>> For additional commands, e-mail: users-help@wicket.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Cannot detect ModalWindow cancel

Posted by Andrea Del Bene <ad...@ciseonweb.it>.
Hi Jered,

this is a known issue, you can find more informations here: 
https://issues.apache.org/jira/browse/WICKET-3809
> I have a ModalWindow where I need to know if the user saved in the 
> WindowClosedCallback or if they chose to click the X to close the 
> window.  To do this in Wicket 1.4, I just set a variable on the page 
> that the ModalWindow gets in the PageCreator and then check the 
> variable in the WindowClosedCallback.  When I try this in Wicket 1.5 
> it doesn't work.  My variable retains the value I initialized it to 
> and not the value I updated it to when I submitted the form on the 
> ModalWindow page.  I am attaching a quickstart with the 1.5.4 version 
> of Wicket.  This is where the bug appears.  I updated the POM and a 
> few files to test the same code with 1.4.19 and it works.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org