Discussion:
Adding Ajax behavior on radio button
jq58
2007-08-08 20:24:03 UTC
Permalink
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Gerolf Seitz
2007-08-08 20:31:45 UTC
Permalink
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
Post by jq58
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?
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Igor Vaynberg
2007-08-08 20:36:20 UTC
Permalink
see AjaxFormChoiceComponentUpdatingBehavior

-igor
Post by jq58
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?
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
jq58
2007-08-08 22:06:53 UTC
Permalink
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).
Post by Igor Vaynberg
see AjaxFormChoiceComponentUpdatingBehavior
-igor
Post by jq58
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?
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Igor Vaynberg
2007-08-08 22:17:53 UTC
Permalink
yes it is 1.3 only, you can probably just copy and paste it into your own
project

-igor
Post by jq58
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).
Post by Igor Vaynberg
see AjaxFormChoiceComponentUpdatingBehavior
-igor
Post by jq58
I have a 2 radio buttons that enable a dropdown and a text field
respectively. Thus, depending on which radio button is selected,
either
Post by Igor Vaynberg
Post by jq58
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?
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
Post by Igor Vaynberg
Post by jq58
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12062792
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Alex Objelean
2007-08-09 06:23:16 UTC
Permalink
Or you can try
http://www.nabble.com/-Question--wicket.markup.html.form.Radio-tf3926549.html#a11160274
this
Post by jq58
.
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).
Post by Igor Vaynberg
see AjaxFormChoiceComponentUpdatingBehavior
-igor
Post by jq58
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?
--
http://www.nabble.com/Adding-Ajax-behavior-on-radio-button-tf4238831.html#a12061159
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
--
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-***@wicket.apache.org
For additional commands, e-mail: users-***@wicket.apache.org
Continue reading on narkive:
Search results for 'Adding Ajax behavior on radio button' (Questions and Answers)
3
replies
ASP.NET / Javascript Problem (Please see details)?
started 2006-07-05 08:26:57 UTC
programming & design
Loading...