You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Steve Flasby <st...@flasby.org> on 2009/04/29 10:30:30 UTC

Ajax + DropDownChoice + ModalWindow

Chaps, struggling a bit with this one.

I want a ModalWindow containing a search form plus a table of results.
I would like the results to be updated using Ajax as I change the search
criteria. One of the search criteria is a DropDownChoice.
So, to handle a selection change I would normally use:

DropDownChoice::onSelectionChanged(){ return true; }

However, this causes a submit which closes the ModalWindow. I cant see
how to get the new value back from the DDC without a submit.

Clearly I am being a bit thick here as I cant possibly be the first
person trying to do this.
Can someone give me a hint please.


Many Thanks - Steve

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


Re: Ajax + DropDownChoice + ModalWindow

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
I remember reading that to make AJAX work in a ModalWindow you need to 
use a PageCreator (and add the panel into the page) instead of just 
adding the panel.

This is how we do it and AJAX works properly;  I think its because 
window content is actually through an IFRAME to the created page.  

The only problem is that you need to set the bounds of the ModalWindow 
yourself (the browser layout mechanism ignores the IFRAME content and 
won't auto size the window.)

Regards,

Mike
> Yeah but you still need to tell the modal window to not care about
> updates, otherwise you will get notifications (confirm dialogs)
>
> 2009/4/29 Serkan Camurcuoglu <Se...@telenity.com>:
>   
>> |maybe using new AjaxFormComponentUpdatingBehavior("onchange") instead of
>> onSelectionChanged would make a difference.. like the example  at
>> http://www.wicket-library.com/wicket-examples/ajax/choice.0|
>>
>>
>>
>> nino martinez wael wrote:
>>     
>>> You need to tell the modal not to care about changes and make the ddc
>>> submit via ajax.. Cant remember the exact setting...
>>>
>>> might be one of below.. But there are some settup you can do something
>>> with..
>>>
>>>
>>>
>>> http://www.nabble.com/forum/Search.jtp?query=modal+nino&local=y&forum=25133&daterange=0&startdate=&enddate=
>>>
>>> 2009/4/29 Steve Flasby <st...@flasby.org>:
>>>
>>>       
>>>> Chaps, struggling a bit with this one.
>>>>
>>>> I want a ModalWindow containing a search form plus a table of results.
>>>> I would like the results to be updated using Ajax as I change the search
>>>> criteria. One of the search criteria is a DropDownChoice.
>>>> So, to handle a selection change I would normally use:
>>>>
>>>> DropDownChoice::onSelectionChanged(){ return true; }
>>>>
>>>> However, this causes a submit which closes the ModalWindow. I cant see
>>>> how to get the new value back from the DDC without a submit.
>>>>
>>>> Clearly I am being a bit thick here as I cant possibly be the first
>>>> person trying to do this.
>>>> Can someone give me a hint please.
>>>>
>>>>
>>>> Many Thanks - Steve
>>>>
>>>> ---------------------------------------------------------------------
>>>> 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: Ajax + DropDownChoice + ModalWindow

Posted by nino martinez wael <ni...@gmail.com>.
Yeah but you still need to tell the modal window to not care about
updates, otherwise you will get notifications (confirm dialogs)

2009/4/29 Serkan Camurcuoglu <Se...@telenity.com>:
> |maybe using new AjaxFormComponentUpdatingBehavior("onchange") instead of
> onSelectionChanged would make a difference.. like the example  at
> http://www.wicket-library.com/wicket-examples/ajax/choice.0|
>
>
>
> nino martinez wael wrote:
>>
>> You need to tell the modal not to care about changes and make the ddc
>> submit via ajax.. Cant remember the exact setting...
>>
>> might be one of below.. But there are some settup you can do something
>> with..
>>
>>
>>
>> http://www.nabble.com/forum/Search.jtp?query=modal+nino&local=y&forum=25133&daterange=0&startdate=&enddate=
>>
>> 2009/4/29 Steve Flasby <st...@flasby.org>:
>>
>>>
>>> Chaps, struggling a bit with this one.
>>>
>>> I want a ModalWindow containing a search form plus a table of results.
>>> I would like the results to be updated using Ajax as I change the search
>>> criteria. One of the search criteria is a DropDownChoice.
>>> So, to handle a selection change I would normally use:
>>>
>>> DropDownChoice::onSelectionChanged(){ return true; }
>>>
>>> However, this causes a submit which closes the ModalWindow. I cant see
>>> how to get the new value back from the DDC without a submit.
>>>
>>> Clearly I am being a bit thick here as I cant possibly be the first
>>> person trying to do this.
>>> Can someone give me a hint please.
>>>
>>>
>>> Many Thanks - Steve
>>>
>>> ---------------------------------------------------------------------
>>> 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: Ajax + DropDownChoice + ModalWindow

Posted by Serkan Camurcuoglu <Se...@telenity.com>.
|maybe using new AjaxFormComponentUpdatingBehavior("onchange") instead 
of onSelectionChanged would make a difference.. like the example  at 
http://www.wicket-library.com/wicket-examples/ajax/choice.0|



nino martinez wael wrote:
> You need to tell the modal not to care about changes and make the ddc
> submit via ajax.. Cant remember the exact setting...
>
> might be one of below.. But there are some settup you can do something with..
>
>
> http://www.nabble.com/forum/Search.jtp?query=modal+nino&local=y&forum=25133&daterange=0&startdate=&enddate=
>
> 2009/4/29 Steve Flasby <st...@flasby.org>:
>   
>> Chaps, struggling a bit with this one.
>>
>> I want a ModalWindow containing a search form plus a table of results.
>> I would like the results to be updated using Ajax as I change the search
>> criteria. One of the search criteria is a DropDownChoice.
>> So, to handle a selection change I would normally use:
>>
>> DropDownChoice::onSelectionChanged(){ return true; }
>>
>> However, this causes a submit which closes the ModalWindow. I cant see
>> how to get the new value back from the DDC without a submit.
>>
>> Clearly I am being a bit thick here as I cant possibly be the first
>> person trying to do this.
>> Can someone give me a hint please.
>>
>>
>> Many Thanks - Steve
>>
>> ---------------------------------------------------------------------
>> 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: Ajax + DropDownChoice + ModalWindow

Posted by nino martinez wael <ni...@gmail.com>.
You need to tell the modal not to care about changes and make the ddc
submit via ajax.. Cant remember the exact setting...

might be one of below.. But there are some settup you can do something with..


http://www.nabble.com/forum/Search.jtp?query=modal+nino&local=y&forum=25133&daterange=0&startdate=&enddate=

2009/4/29 Steve Flasby <st...@flasby.org>:
> Chaps, struggling a bit with this one.
>
> I want a ModalWindow containing a search form plus a table of results.
> I would like the results to be updated using Ajax as I change the search
> criteria. One of the search criteria is a DropDownChoice.
> So, to handle a selection change I would normally use:
>
> DropDownChoice::onSelectionChanged(){ return true; }
>
> However, this causes a submit which closes the ModalWindow. I cant see
> how to get the new value back from the DDC without a submit.
>
> Clearly I am being a bit thick here as I cant possibly be the first
> person trying to do this.
> Can someone give me a hint please.
>
>
> Many Thanks - Steve
>
> ---------------------------------------------------------------------
> 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: Ajax + DropDownChoice + ModalWindow

Posted by nino martinez wael <ni...@gmail.com>.
And this one aswell, grabbed from the other thread:


               <script language="javascript" type="text/javascript">
                       jQuery(document).ready(function(){
                               if (typeof Wicket != 'undefined' &&
Wicket.Window)
                                       Wicket.Window.unloadConfirmation = false;
                       });
               </script>

2009/4/29 TahitianGabriel <gl...@piti.pf>:
>
> With Ajax you should use (instead of onSelectionChanged) :
>
> myDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
>            protected void onUpdate(final AjaxRequestTarget varTarget) {
>                /* do you stuff here... */
>
>                if (varTarget != null) {
>                    /* update your components */
>                    varTarget.addComponent(componenToUpdate);
>                }
>            }
> }
>
> Regards,
>
> Gabriel.
>
>
> Steve Flasby wrote:
>>
>>
>> So, to handle a selection change I would normally use:
>>
>> DropDownChoice::onSelectionChanged(){ return true; }
>>
>>
>
> --
> View this message in context: http://www.nabble.com/Ajax-%2B-DropDownChoice-%2B-ModalWindow-tp23292894p23298704.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> 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: Ajax + DropDownChoice + ModalWindow

Posted by TahitianGabriel <gl...@piti.pf>.
With Ajax you should use (instead of onSelectionChanged) : 

myDropDown.add(new AjaxFormComponentUpdatingBehavior("onchange") {
            protected void onUpdate(final AjaxRequestTarget varTarget) {
                /* do you stuff here... */

                if (varTarget != null) {
                    /* update your components */
                    varTarget.addComponent(componenToUpdate);
                }
            }
}

Regards,

Gabriel.


Steve Flasby wrote:
> 
> 
> So, to handle a selection change I would normally use:
> 
> DropDownChoice::onSelectionChanged(){ return true; }
> 
> 

-- 
View this message in context: http://www.nabble.com/Ajax-%2B-DropDownChoice-%2B-ModalWindow-tp23292894p23298704.html
Sent from the Wicket - User mailing list archive at Nabble.com.


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