You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by jq58 <qu...@gmail.com> on 2007/08/08 22:24:03 UTC

Adding Ajax behavior on radio button

I have a 2 radio buttons that enable a dropdown and a text field
respectively.  Thus, depending on which radio button is selected, either the
dropdown or the text field is enabled.

Thus I need ajax capability when a radio button is selected, but evidently
this can't happen in Wicket, because, for some reason, the radio button is
not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
AjaxComponentUpdatingBehavior() is available).

What is the best way to get around this?

-- 
View this message in context: http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
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


Re: Adding Ajax behavior on radio button

Posted by Gerolf Seitz <ge...@gmail.com>.
you could probably go with an all javascript solution, although i don't know
if that confuses client- and serverside state.
so, when a radiobutton gets clicked, you enable the particular component and
disable the other.

gerolf

On 8/8/07, jq58 <qu...@gmail.com> wrote:
>
>
> I have a 2 radio buttons that enable a dropdown and a text field
> respectively.  Thus, depending on which radio button is selected, either
> the
> dropdown or the text field is enabled.
>
> Thus I need ajax capability when a radio button is selected, but evidently
> this can't happen in Wicket, because, for some reason, the radio button is
> not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
> AjaxComponentUpdatingBehavior() is available).
>
> What is the best way to get around this?
>
> --
> View this message in context:
> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
> 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
>
>

Re: Adding Ajax behavior on radio button

Posted by Igor Vaynberg <ig...@gmail.com>.
yes it is 1.3 only, you can probably just copy and paste it into your own
project

-igor


On 8/8/07, jq58 <qu...@gmail.com> wrote:
>
>
> This looks like it's 1.3, I'm on 1.2.6.
>
> Is it 1.3?
>
> Maybe AjaxEventBehavior(onchange) could help?
> It seems to be acting erratic though.
>
> I can get to the  onEvent method on on button, but not the other.  Have
> exactly the  same onEvent method set up on both radio buttons (which are
> part of a radio group).
>
>
>
> igor.vaynberg wrote:
> >
> > see AjaxFormChoiceComponentUpdatingBehavior
> >
> > -igor
> >
> >
> > On 8/8/07, jq58 <qu...@gmail.com> wrote:
> >>
> >>
> >> I have a 2 radio buttons that enable a dropdown and a text field
> >> respectively.  Thus, depending on which radio button is selected,
> either
> >> the
> >> dropdown or the text field is enabled.
> >>
> >> Thus I need ajax capability when a radio button is selected, but
> >> evidently
> >> this can't happen in Wicket, because, for some reason, the radio button
> >> is
> >> not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
> >> AjaxComponentUpdatingBehavior() is available).
> >>
> >> What is the best way to get around this?
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
> >> 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
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12062792
> 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
>
>

Re: Adding Ajax behavior on radio button

Posted by Alex Objelean <al...@isdc.ro>.
Or you can try 
http://www.nabble.com/-Question--wicket.markup.html.form.Radio-tf3926549.html#a11160274
this 


jq58 wrote:
> .
> 
> This looks like it's 1.3, I'm on 1.2.6.
> 
> Is it 1.3?
> 
> Maybe AjaxEventBehavior(onchange) could help? 
> It seems to be acting erratic though.
> 
> I can get to the  onEvent method on on button, but not the other.  Have
> exactly the  same onEvent method set up on both radio buttons (which are
> part of a radio group).
> 
> 
> 
> igor.vaynberg wrote:
>> 
>> see AjaxFormChoiceComponentUpdatingBehavior
>> 
>> -igor
>> 
>> 
>> On 8/8/07, jq58 <qu...@gmail.com> wrote:
>>>
>>>
>>> I have a 2 radio buttons that enable a dropdown and a text field
>>> respectively.  Thus, depending on which radio button is selected, either
>>> the
>>> dropdown or the text field is enabled.
>>>
>>> Thus I need ajax capability when a radio button is selected, but
>>> evidently
>>> this can't happen in Wicket, because, for some reason, the radio button
>>> is
>>> not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
>>> AjaxComponentUpdatingBehavior() is available).
>>>
>>> What is the best way to get around this?
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
>>> 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
>>>
>>>
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12067079
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


Re: Adding Ajax behavior on radio button

Posted by jq58 <qu...@gmail.com>.
This looks like it's 1.3, I'm on 1.2.6.

Is it 1.3?

Maybe AjaxEventBehavior(onchange) could help? 
It seems to be acting erratic though.

I can get to the  onEvent method on on button, but not the other.  Have
exactly the  same onEvent method set up on both radio buttons (which are
part of a radio group).



igor.vaynberg wrote:
> 
> see AjaxFormChoiceComponentUpdatingBehavior
> 
> -igor
> 
> 
> On 8/8/07, jq58 <qu...@gmail.com> wrote:
>>
>>
>> I have a 2 radio buttons that enable a dropdown and a text field
>> respectively.  Thus, depending on which radio button is selected, either
>> the
>> dropdown or the text field is enabled.
>>
>> Thus I need ajax capability when a radio button is selected, but
>> evidently
>> this can't happen in Wicket, because, for some reason, the radio button
>> is
>> not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
>> AjaxComponentUpdatingBehavior() is available).
>>
>> What is the best way to get around this?
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
>> 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
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12062792
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


Re: Adding Ajax behavior on radio button

Posted by Igor Vaynberg <ig...@gmail.com>.
see AjaxFormChoiceComponentUpdatingBehavior

-igor


On 8/8/07, jq58 <qu...@gmail.com> wrote:
>
>
> I have a 2 radio buttons that enable a dropdown and a text field
> respectively.  Thus, depending on which radio button is selected, either
> the
> dropdown or the text field is enabled.
>
> Thus I need ajax capability when a radio button is selected, but evidently
> this can't happen in Wicket, because, for some reason, the radio button is
> not a FormComponent (new AjaxFormComponentUpdatingBehavior(), not new
> AjaxComponentUpdatingBehavior() is available).
>
> What is the best way to get around this?
>
> --
> View this message in context:
> http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
> 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
>
>