You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by alshamsi <su...@gmail.com> on 2007/11/16 08:33:56 UTC
Required RadioGroup
Hi All,
I want to add the required validation on a RadioGroup component. I added the
setRequired(true); What happens is that if the user did not select a radio
choice the validation msg will be shown. what should be the case. but if the
user selected a radio after that, the same msg will appear?! instead the
user was suppose to be redirected to another page..
RadioGroup group = new RadioGroup("type");
ListView modes = new ListView("numbers", NUMBERS)
{
protected void populateItem(ListItem item)
{
item.add(new Radio("radio", item.getModel()));
item.add(new Label("number",
item.getModelObjectAsString()));
};
};
group.add(modes);
group.setRequired(true);
add(group);
Regards,
Alshamsi
--
View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
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: Required RadioGroup
Posted by Suad AlShamsi <su...@gmail.com>.
I am using 1.3 beta 4. I copied from wicket examples as well but its not
working.
Martijn Dashorst wrote:
> I just did this in the FormInput example of Wicket examples
> (1.3.0-rc1) and it works:
>
> RadioGroup group = new RadioGroup("numbersGroup");
> add(group);
> ListView persons = new ListView("numbers", NUMBERS)
> {
> @Override
> protected void populateItem(ListItem item)
> {
> item.add(new Radio("radio", item.getModel()));
> item.add(new Label("number", item.getModelObjectAsString()));
> };
> }.setReuseItems(true);
> group.add(persons);
> group.setRequired(true);
>
>
> Martijn
>
> On 11/16/07, Martijn Dashorst <ma...@gmail.com> wrote:
>
>> what version of Wicket are you working on?
>>
>> On 11/16/07, Suad AlShamsi <su...@gmail.com> wrote:
>>
>>> I added it .. Nothing changed?! I am still getting the same problem.
>>>
>>> Martijn Dashorst wrote:
>>>
>>>> add:
>>>>
>>>> modes.setReuseItems(true);
>>>>
>>>> Martijn
>>>>
>>>> On 11/16/07, alshamsi <su...@gmail.com> wrote:
>>>>
>>>>
>>>>> Hi All,
>>>>>
>>>>> I want to add the required validation on a RadioGroup component. I added the
>>>>> setRequired(true); What happens is that if the user did not select a radio
>>>>> choice the validation msg will be shown. what should be the case. but if the
>>>>> user selected a radio after that, the same msg will appear?! instead the
>>>>> user was suppose to be redirected to another page..
>>>>>
>>>>>
>>>>>
>>>>> RadioGroup group = new RadioGroup("type");
>>>>> ListView modes = new ListView("numbers", NUMBERS)
>>>>> {
>>>>> protected void populateItem(ListItem item)
>>>>> {
>>>>> item.add(new Radio("radio", item.getModel()));
>>>>> item.add(new Label("number",
>>>>> item.getModelObjectAsString()));
>>>>> };
>>>>> };
>>>>>
>>>>> group.add(modes);
>>>>> group.setRequired(true);
>>>>> add(group);
>>>>>
>>>>> Regards,
>>>>> Alshamsi
>>>>> --
>>>>> View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
>>>>> 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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>> --
>> Buy Wicket in Action: http://manning.com/dashorst
>> Apache Wicket 1.3.0-rc1 is released
>> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
>>
>>
>
>
>
Re: Required RadioGroup
Posted by Martijn Dashorst <ma...@gmail.com>.
I just did this in the FormInput example of Wicket examples
(1.3.0-rc1) and it works:
RadioGroup group = new RadioGroup("numbersGroup");
add(group);
ListView persons = new ListView("numbers", NUMBERS)
{
@Override
protected void populateItem(ListItem item)
{
item.add(new Radio("radio", item.getModel()));
item.add(new Label("number", item.getModelObjectAsString()));
};
}.setReuseItems(true);
group.add(persons);
group.setRequired(true);
Martijn
On 11/16/07, Martijn Dashorst <ma...@gmail.com> wrote:
> what version of Wicket are you working on?
>
> On 11/16/07, Suad AlShamsi <su...@gmail.com> wrote:
> > I added it .. Nothing changed?! I am still getting the same problem.
> >
> > Martijn Dashorst wrote:
> > > add:
> > >
> > > modes.setReuseItems(true);
> > >
> > > Martijn
> > >
> > > On 11/16/07, alshamsi <su...@gmail.com> wrote:
> > >
> > >> Hi All,
> > >>
> > >> I want to add the required validation on a RadioGroup component. I added the
> > >> setRequired(true); What happens is that if the user did not select a radio
> > >> choice the validation msg will be shown. what should be the case. but if the
> > >> user selected a radio after that, the same msg will appear?! instead the
> > >> user was suppose to be redirected to another page..
> > >>
> > >>
> > >>
> > >> RadioGroup group = new RadioGroup("type");
> > >> ListView modes = new ListView("numbers", NUMBERS)
> > >> {
> > >> protected void populateItem(ListItem item)
> > >> {
> > >> item.add(new Radio("radio", item.getModel()));
> > >> item.add(new Label("number",
> > >> item.getModelObjectAsString()));
> > >> };
> > >> };
> > >>
> > >> group.add(modes);
> > >> group.setRequired(true);
> > >> add(group);
> > >>
> > >> Regards,
> > >> Alshamsi
> > >> --
> > >> View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
> > >> 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
> > >>
> > >>
> > >>
> > >
> > >
> > >
> >
> >
>
>
> --
> Buy Wicket in Action: http://manning.com/dashorst
> Apache Wicket 1.3.0-rc1 is released
> Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Required RadioGroup
Posted by Martijn Dashorst <ma...@gmail.com>.
what version of Wicket are you working on?
On 11/16/07, Suad AlShamsi <su...@gmail.com> wrote:
> I added it .. Nothing changed?! I am still getting the same problem.
>
> Martijn Dashorst wrote:
> > add:
> >
> > modes.setReuseItems(true);
> >
> > Martijn
> >
> > On 11/16/07, alshamsi <su...@gmail.com> wrote:
> >
> >> Hi All,
> >>
> >> I want to add the required validation on a RadioGroup component. I added the
> >> setRequired(true); What happens is that if the user did not select a radio
> >> choice the validation msg will be shown. what should be the case. but if the
> >> user selected a radio after that, the same msg will appear?! instead the
> >> user was suppose to be redirected to another page..
> >>
> >>
> >>
> >> RadioGroup group = new RadioGroup("type");
> >> ListView modes = new ListView("numbers", NUMBERS)
> >> {
> >> protected void populateItem(ListItem item)
> >> {
> >> item.add(new Radio("radio", item.getModel()));
> >> item.add(new Label("number",
> >> item.getModelObjectAsString()));
> >> };
> >> };
> >>
> >> group.add(modes);
> >> group.setRequired(true);
> >> add(group);
> >>
> >> Regards,
> >> Alshamsi
> >> --
> >> View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
> >> 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
> >>
> >>
> >>
> >
> >
> >
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Required RadioGroup
Posted by Suad AlShamsi <su...@gmail.com>.
I added it .. Nothing changed?! I am still getting the same problem.
Martijn Dashorst wrote:
> add:
>
> modes.setReuseItems(true);
>
> Martijn
>
> On 11/16/07, alshamsi <su...@gmail.com> wrote:
>
>> Hi All,
>>
>> I want to add the required validation on a RadioGroup component. I added the
>> setRequired(true); What happens is that if the user did not select a radio
>> choice the validation msg will be shown. what should be the case. but if the
>> user selected a radio after that, the same msg will appear?! instead the
>> user was suppose to be redirected to another page..
>>
>>
>>
>> RadioGroup group = new RadioGroup("type");
>> ListView modes = new ListView("numbers", NUMBERS)
>> {
>> protected void populateItem(ListItem item)
>> {
>> item.add(new Radio("radio", item.getModel()));
>> item.add(new Label("number",
>> item.getModelObjectAsString()));
>> };
>> };
>>
>> group.add(modes);
>> group.setRequired(true);
>> add(group);
>>
>> Regards,
>> Alshamsi
>> --
>> View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
>> 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: Required RadioGroup
Posted by Martijn Dashorst <ma...@gmail.com>.
add:
modes.setReuseItems(true);
Martijn
On 11/16/07, alshamsi <su...@gmail.com> wrote:
>
> Hi All,
>
> I want to add the required validation on a RadioGroup component. I added the
> setRequired(true); What happens is that if the user did not select a radio
> choice the validation msg will be shown. what should be the case. but if the
> user selected a radio after that, the same msg will appear?! instead the
> user was suppose to be redirected to another page..
>
>
>
> RadioGroup group = new RadioGroup("type");
> ListView modes = new ListView("numbers", NUMBERS)
> {
> protected void populateItem(ListItem item)
> {
> item.add(new Radio("radio", item.getModel()));
> item.add(new Label("number",
> item.getModelObjectAsString()));
> };
> };
>
> group.add(modes);
> group.setRequired(true);
> add(group);
>
> Regards,
> Alshamsi
> --
> View this message in context: http://www.nabble.com/Required-RadioGroup-tf4819483.html#a13788217
> 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
>
>
--
Buy Wicket in Action: http://manning.com/dashorst
Apache Wicket 1.3.0-rc1 is released
Get it now: http://www.apache.org/dyn/closer.cgi/wicket/1.3.0-rc1/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org