You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Michael Mehrle <mi...@ask.com> on 2008/04/04 02:49:21 UTC

Default selection in radio group?

I created a RadioGroup with three radios attached. For some reason the form is being drawn with the last radio pre-selected, which I don't want. How can I pre-select a default radio and also how can I set the group to nothing selected?

Thanks,

Michael


RE: Default selection in radio group?

Posted by Michael Mehrle <mi...@ask.com>.
Yes, that actually worked for me - thanks!! 

Michael

-----Original Message-----
From: Cristi Manole [mailto:cristimanole@gmail.com] 
Sent: Friday, April 04, 2008 5:33 AM
To: users@wicket.apache.org
Subject: Re: Default selection in radio group?

Hi,

What I did is use the same model for the group and for the radio item I
want
selected.
For example:

add(radioGroup = new RadioGroup("group", new Model("selectthis")));
//the
radio who has the same model will be selected

radioGroup.add(someradio1Radio = new Radio("someradio1radio", new
Model("selectthis")));
radioGroup.add(someradio2Radio = new Radio("someradio2radio", new
Model("")));
radioGroup.add(someradio3Radio = new Radio("someradio3radio", new
Model("")));

I hope this helps,
Cristi Manole

On Fri, Apr 4, 2008 at 3:01 PM, Hoover, William <wh...@nemours.org>
wrote:

> see
http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups
>
> -----Original Message-----
> From: Michael Mehrle [mailto:michael.mehrle@ask.com]
> Sent: Thursday, April 03, 2008 8:49 PM
> To: users@wicket.apache.org
> Subject: Default selection in radio group?
>
>
> I created a RadioGroup with three radios attached. For some reason the
> form is being drawn with the last radio pre-selected, which I don't
want.
> How can I pre-select a default radio and also how can I set the group
to
> nothing selected?
>
> Thanks,
>
> Michael
>
>

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


Re: Default selection in radio group?

Posted by Cristi Manole <cr...@gmail.com>.
Hi,

What I did is use the same model for the group and for the radio item I want
selected.
For example:

add(radioGroup = new RadioGroup("group", new Model("selectthis"))); //the
radio who has the same model will be selected

radioGroup.add(someradio1Radio = new Radio("someradio1radio", new
Model("selectthis")));
radioGroup.add(someradio2Radio = new Radio("someradio2radio", new
Model("")));
radioGroup.add(someradio3Radio = new Radio("someradio3radio", new
Model("")));

I hope this helps,
Cristi Manole

On Fri, Apr 4, 2008 at 3:01 PM, Hoover, William <wh...@nemours.org> wrote:

> see http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups
>
> -----Original Message-----
> From: Michael Mehrle [mailto:michael.mehrle@ask.com]
> Sent: Thursday, April 03, 2008 8:49 PM
> To: users@wicket.apache.org
> Subject: Default selection in radio group?
>
>
> I created a RadioGroup with three radios attached. For some reason the
> form is being drawn with the last radio pre-selected, which I don't want.
> How can I pre-select a default radio and also how can I set the group to
> nothing selected?
>
> Thanks,
>
> Michael
>
>

RE: Default selection in radio group?

Posted by "Hoover, William " <wh...@nemours.org>.
see http://cwiki.apache.org/confluence/display/WICKET/Using+RadioGroups

-----Original Message-----
From: Michael Mehrle [mailto:michael.mehrle@ask.com]
Sent: Thursday, April 03, 2008 8:49 PM
To: users@wicket.apache.org
Subject: Default selection in radio group?


I created a RadioGroup with three radios attached. For some reason the form is being drawn with the last radio pre-selected, which I don't want. How can I pre-select a default radio and also how can I set the group to nothing selected?

Thanks,

Michael