You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by tommy <to...@gmail.com> on 2010/11/03 12:40:02 UTC

How can I create RadioGroups that are not defined by component hierarchy/layout ?

I asked the following question on stack-overflow but was advised to ask here
instead.
http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc

I am using Wicket and would like to create a grid of radio buttons using
html as shown below (outer lists will be displayed vertically, inner lists
will be displayed horizontally).

I would like the radio buttons grouped vertically.

<ul>
  <li>
    <ul>
       <li><input type="radio" name="A"></li>
       <li><input type="radio" name="B"></li>
       <li><input type="radio" name="C"></li>
    </ul>
  </li>
  <li>
    <ul>
       <li><input type="radio" name="A"></li>
       <li><input type="radio" name="B"></li>
       <li><input type="radio" name="C"></li>
    </ul>
  </li>
  <li>
    <ul>
       <li><input type="radio" name="A"></li>
       <li><input type="radio" name="B"></li>
       <li><input type="radio" name="C"></li>
    </ul>
  </li>
</ul>

Unfortunately it seems that RadioGroup only allow one to group radio buttons
according to the grouping defined by their layout.

eg RadioGroup group = new RadioGroup("radioGroupA");

group.add( new Radio("myradio", new Model(1)) ;

Problem with this is that I cannot then layout the way I want.

Is there another way? Manually specifying the name and gather results?

UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one can
do something like:

// create some groups
for (0..n) {
  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
  groupArray.add(group)
}

//create a ListView for the RadioGroups so we can attach them to page
ListView radioListView = ListView("radioGroupList") { populate from
groupArray }
add(radioListView);

// create our grid of radio buttons
// outer -> rows
for (0..x) {
  // inner -> columns
  for (0..n)
    // supply group from our groupArray
    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
  }
}

I can then add the Radios and RadioGroups to the form independently of
layout and this has the desired effect in terms of the grouping.

<form>
  < span wicket:id="radioGroupList">
     < span wicket:id="radioGroup"/>
  < /span>
  <ul>
    <li><radio wicket:id="myradio"/></li>

But now, when I submit I am getting the following error:

WicketMessage: submitted http post value [radio33] for RadioGroup component
[2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
is illegal because it does not contain relative path to a Radio componnet.
Due to this the RadioGroup component cannot resolve the selected Radio
component pointed to by the illegal value. A possible reason is that
componment hierarchy changed between rendering and form submission.

Any idea what this means?

The spelling mistake 'componment' suggests it's not seen too often.

I am using wicket 1.4.12.

I found this ticket that looks related too :
https://issues.apache.org/jira/browse/WICKET-1055

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by tommy <to...@gmail.com>.
Thanks  - how do how do you create the nested HTML markup for this if number
of groups is variable? ie there could be 3,4,5,6,7.. groups.

Tom

On Thu, Nov 4, 2010 at 3:38 PM, Igor Vaynberg-2 [via Apache Wicket] <
ml-node+3027246-253593379-201123@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> see here
>
>
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc/
>
> -igor
>
> On Wed, Nov 3, 2010 at 11:51 AM, tommy <[hidden email]<http://user/SendEmail.jtp?type=node&node=3027246&i=0>>
> wrote:
>
> >
> > ok thanks, I'll try and put something together tonight. Are you able to
> > answer either of those questions?
> >
> > On Wed, Nov 3, 2010 at 5:56 PM, Igor Vaynberg-2 [via Apache Wicket] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3027246&i=1><[hidden
> email] <http://user/SendEmail.jtp?type=node&node=3027246&i=2>>
> >> wrote:
> >
> >> http://wicket.apache.org/start/quickstart.html
> >>
> >> -igor
> >>
> >> On Wed, Nov 3, 2010 at 9:03 AM, tommy <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025865&i=0>>
> >> wrote:
> >>
> >> >
> >> > Hi
> >> > Can you point me to a link that explains what a quickstart is and how
> I
> >> > create one?
> >> >
> >> > Also maybe you consider these questions
> >> >
> >> > 1. If I can pass in a RadioGroup object to a Radio() constructor does
> the
> >>
> >> > RadioGroup also need to be added to the page and if so, does it matter
>
> >> where
> >> > on the page the RadioGroup is rendered, and in both cases: why the
> need?
> >> > given that the Radio objects are now bound to the RadioGroup object
> >> > directly.
> >> >
> >> > 2. Are there any examples of RadioGroup/Radio usage where RadioGroup
> is
> >> > passed in to the Radio() constructor?
> >> >
> >> > Thanks, Tom
> >> >
> >> > On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
> >> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3025865&i=1><[hidden
>
> >> email] <http://user/SendEmail.jtp?type=node&node=3025865&i=2>>
> >> >> wrote:
> >> >
> >> >> best way for us to help you is for you to create a quickstart and
> >> >> attach it to your email or a jira issue.
> >> >>
> >> >> -igor
> >> >>
> >> >> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
> >> >> wrote:
> >> >>
> >> >> >
> >> >> > I asked the following question on stack-overflow but was advised to
>
> >> ask
> >> >> here
> >> >> > instead.
> >> >> >
> >> >>
> >>
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
> >> >> >
> >> >> > I am using Wicket and would like to create a grid of radio buttons
> >> using
> >> >> > html as shown below (outer lists will be displayed vertically,
> inner
> >> >> lists
> >> >> > will be displayed horizontally).
> >> >> >
> >> >> > I would like the radio buttons grouped vertically.
> >> >> >
> >> >> > <ul>
> >> >> >  <li>
> >> >> >    <ul>
> >> >> >       <li><input type="radio" name="A"></li>
> >> >> >       <li><input type="radio" name="B"></li>
> >> >> >       <li><input type="radio" name="C"></li>
> >> >> >    </ul>
> >> >> >  </li>
> >> >> >  <li>
> >> >> >    <ul>
> >> >> >       <li><input type="radio" name="A"></li>
> >> >> >       <li><input type="radio" name="B"></li>
> >> >> >       <li><input type="radio" name="C"></li>
> >> >> >    </ul>
> >> >> >  </li>
> >> >> >  <li>
> >> >> >    <ul>
> >> >> >       <li><input type="radio" name="A"></li>
> >> >> >       <li><input type="radio" name="B"></li>
> >> >> >       <li><input type="radio" name="C"></li>
> >> >> >    </ul>
> >> >> >  </li>
> >> >> > </ul>
> >> >> >
> >> >> > Unfortunately it seems that RadioGroup only allow one to group
> radio
> >> >> buttons
> >> >> > according to the grouping defined by their layout.
> >> >> >
> >> >> > eg RadioGroup group = new RadioGroup("radioGroupA");
> >> >> >
> >> >> > group.add( new Radio("myradio", new Model(1)) ;
> >> >> >
> >> >> > Problem with this is that I cannot then layout the way I want.
> >> >> >
> >> >> > Is there another way? Manually specifying the name and gather
> results?
> >>
> >> >> >
> >> >> > UPDATE: I notice that Radio can take a RadioGroup as a parameter.
> So
> >> one
> >> >> can
> >> >> > do something like:
> >> >> >
> >> >> > // create some groups
> >> >> > for (0..n) {
> >> >> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. }
> );
> >>
> >> >> >  groupArray.add(group)
> >> >> > }
> >> >> >
> >> >> > //create a ListView for the RadioGroups so we can attach them to
> page
> >> >> > ListView radioListView = ListView("radioGroupList") { populate from
>
> >> >> > groupArray }
> >> >> > add(radioListView);
> >> >> >
> >> >> > // create our grid of radio buttons
> >> >> > // outer -> rows
> >> >> > for (0..x) {
> >> >> >  // inner -> columns
> >> >> >  for (0..n)
> >> >> >    // supply group from our groupArray
> >> >> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
> >> >> >  }
> >> >> > }
> >> >> >
> >> >> > I can then add the Radios and RadioGroups to the form independently
> of
> >>
> >> >> > layout and this has the desired effect in terms of the grouping.
> >> >> >
> >> >> > <form>
> >> >> >  < span wicket:id="radioGroupList">
> >> >> >     < span wicket:id="radioGroup"/>
> >> >> >  < /span>
> >> >> >  <ul>
> >> >> >    <li><radio wicket:id="myradio"/></li>
> >> >> >
> >> >> > But now, when I submit I am getting the following error:
> >> >> >
> >> >> > WicketMessage: submitted http post value [radio33] for RadioGroup
> >> >> component
> >> >> >
> >> >>
> >>
> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>
> >>
> >> >>
> >> >> > is illegal because it does not contain relative path to a Radio
> >> >> componnet.
> >> >> > Due to this the RadioGroup component cannot resolve the selected
> Radio
> >>
> >> >> > component pointed to by the illegal value. A possible reason is
> that
> >> >> > componment hierarchy changed between rendering and form submission.
>
> >> >> >
> >> >> > Any idea what this means?
> >> >> >
> >> >> > The spelling mistake 'componment' suggests it's not seen too often.
>
> >> >> >
> >> >> > I am using wicket 1.4.12.
> >> >> >
> >> >> > I found this ticket that looks related too :
> >> >> > https://issues.apache.org/jira/browse/WICKET-1055
> >> >> >
> >> >> > --
> >> >> > View this message in context:
> >> >>
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t>>
>
> >> <
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t&by-user=t>>>
>
> >>
> >> >> > Sent from the Users forum mailing list archive at Nabble.com.
> >> >> >
> >> >> >
> ---------------------------------------------------------------------
> >> >> > To unsubscribe, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=3025609&i=1>
> >> >> > For additional commands, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=3025609&i=2>
> >> >> >
> >> >> >
> >> >>
> >> >> ---------------------------------------------------------------------
>
> >> >> To unsubscribe, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=3025609&i=3>
> >> >> For additional commands, e-mail: [hidden email]<
> >> http://user/SendEmail.jtp?type=node&node=3025609&i=4>
> >> >>
> >> >>
> >> >>
> >> >> ------------------------------
> >> >>  View message @
> >> >>
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html?by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html?by-user=t&by-user=t>>
>
> >> >> To unsubscribe from How can I create RadioGroups that are not defined
> by
> >>
> >> >> component hierarchy/layout ?, click here<
> >>
> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t&by-user=t>>>.
>
> >>
> >> >>
> >> >>
> >> >>
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html?by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html?by-user=t&by-user=t>>
>
> >>
> >> > Sent from the Users forum mailing list archive at Nabble.com.
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025865&i=3>
> >> > For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025865&i=4>
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025865&i=5>
> >> For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025865&i=6>
> >>
> >>
> >>
> >> ------------------------------
> >>  View message @
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025865.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025865.html?by-user=t>
> >> To unsubscribe from How can I create RadioGroups that are not defined by
>
> >> component hierarchy/layout ?, click here<
> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t>>.
>
> >>
> >>
> >>
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025955.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025955.html?by-user=t>
>
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3027246&i=3>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3027246&i=4>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3027246&i=5>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3027246&i=6>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3027246.html
> To unsubscribe from How can I create RadioGroups that are not defined by
> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3027286.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

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

http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc/

-igor

On Wed, Nov 3, 2010 at 11:51 AM, tommy <to...@gmail.com> wrote:
>
> ok thanks, I'll try and put something together tonight. Are you able to
> answer either of those questions?
>
> On Wed, Nov 3, 2010 at 5:56 PM, Igor Vaynberg-2 [via Apache Wicket] <
> ml-node+3025865-1659550532-201123@n4.nabble.com<ml...@n4.nabble.com>
>> wrote:
>
>> http://wicket.apache.org/start/quickstart.html
>>
>> -igor
>>
>> On Wed, Nov 3, 2010 at 9:03 AM, tommy <[hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=0>>
>> wrote:
>>
>> >
>> > Hi
>> > Can you point me to a link that explains what a quickstart is and how I
>> > create one?
>> >
>> > Also maybe you consider these questions
>> >
>> > 1. If I can pass in a RadioGroup object to a Radio() constructor does the
>>
>> > RadioGroup also need to be added to the page and if so, does it matter
>> where
>> > on the page the RadioGroup is rendered, and in both cases: why the need?
>> > given that the Radio objects are now bound to the RadioGroup object
>> > directly.
>> >
>> > 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
>> > passed in to the Radio() constructor?
>> >
>> > Thanks, Tom
>> >
>> > On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3025865&i=1><[hidden
>> email] <http://user/SendEmail.jtp?type=node&node=3025865&i=2>>
>> >> wrote:
>> >
>> >> best way for us to help you is for you to create a quickstart and
>> >> attach it to your email or a jira issue.
>> >>
>> >> -igor
>> >>
>> >> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
>> >> wrote:
>> >>
>> >> >
>> >> > I asked the following question on stack-overflow but was advised to
>> ask
>> >> here
>> >> > instead.
>> >> >
>> >>
>> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>> >> >
>> >> > I am using Wicket and would like to create a grid of radio buttons
>> using
>> >> > html as shown below (outer lists will be displayed vertically, inner
>> >> lists
>> >> > will be displayed horizontally).
>> >> >
>> >> > I would like the radio buttons grouped vertically.
>> >> >
>> >> > <ul>
>> >> >  <li>
>> >> >    <ul>
>> >> >       <li><input type="radio" name="A"></li>
>> >> >       <li><input type="radio" name="B"></li>
>> >> >       <li><input type="radio" name="C"></li>
>> >> >    </ul>
>> >> >  </li>
>> >> >  <li>
>> >> >    <ul>
>> >> >       <li><input type="radio" name="A"></li>
>> >> >       <li><input type="radio" name="B"></li>
>> >> >       <li><input type="radio" name="C"></li>
>> >> >    </ul>
>> >> >  </li>
>> >> >  <li>
>> >> >    <ul>
>> >> >       <li><input type="radio" name="A"></li>
>> >> >       <li><input type="radio" name="B"></li>
>> >> >       <li><input type="radio" name="C"></li>
>> >> >    </ul>
>> >> >  </li>
>> >> > </ul>
>> >> >
>> >> > Unfortunately it seems that RadioGroup only allow one to group radio
>> >> buttons
>> >> > according to the grouping defined by their layout.
>> >> >
>> >> > eg RadioGroup group = new RadioGroup("radioGroupA");
>> >> >
>> >> > group.add( new Radio("myradio", new Model(1)) ;
>> >> >
>> >> > Problem with this is that I cannot then layout the way I want.
>> >> >
>> >> > Is there another way? Manually specifying the name and gather results?
>>
>> >> >
>> >> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So
>> one
>> >> can
>> >> > do something like:
>> >> >
>> >> > // create some groups
>> >> > for (0..n) {
>> >> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>>
>> >> >  groupArray.add(group)
>> >> > }
>> >> >
>> >> > //create a ListView for the RadioGroups so we can attach them to page
>> >> > ListView radioListView = ListView("radioGroupList") { populate from
>> >> > groupArray }
>> >> > add(radioListView);
>> >> >
>> >> > // create our grid of radio buttons
>> >> > // outer -> rows
>> >> > for (0..x) {
>> >> >  // inner -> columns
>> >> >  for (0..n)
>> >> >    // supply group from our groupArray
>> >> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
>> >> >  }
>> >> > }
>> >> >
>> >> > I can then add the Radios and RadioGroups to the form independently of
>>
>> >> > layout and this has the desired effect in terms of the grouping.
>> >> >
>> >> > <form>
>> >> >  < span wicket:id="radioGroupList">
>> >> >     < span wicket:id="radioGroup"/>
>> >> >  < /span>
>> >> >  <ul>
>> >> >    <li><radio wicket:id="myradio"/></li>
>> >> >
>> >> > But now, when I submit I am getting the following error:
>> >> >
>> >> > WicketMessage: submitted http post value [radio33] for RadioGroup
>> >> component
>> >> >
>> >>
>> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>>
>> >>
>> >> > is illegal because it does not contain relative path to a Radio
>> >> componnet.
>> >> > Due to this the RadioGroup component cannot resolve the selected Radio
>>
>> >> > component pointed to by the illegal value. A possible reason is that
>> >> > componment hierarchy changed between rendering and form submission.
>> >> >
>> >> > Any idea what this means?
>> >> >
>> >> > The spelling mistake 'componment' suggests it's not seen too often.
>> >> >
>> >> > I am using wicket 1.4.12.
>> >> >
>> >> > I found this ticket that looks related too :
>> >> > https://issues.apache.org/jira/browse/WICKET-1055
>> >> >
>> >> > --
>> >> > View this message in context:
>> >>
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t>
>> <
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t>>
>>
>> >> > Sent from the Users forum mailing list archive at Nabble.com.
>> >> >
>> >> > ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=1>
>> >> > For additional commands, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=2>
>> >> >
>> >> >
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=3>
>> >> For additional commands, e-mail: [hidden email]<
>> http://user/SendEmail.jtp?type=node&node=3025609&i=4>
>> >>
>> >>
>> >>
>> >> ------------------------------
>> >>  View message @
>> >>
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html?by-user=t>
>> >> To unsubscribe from How can I create RadioGroups that are not defined by
>>
>> >> component hierarchy/layout ?, click here<
>> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t>>.
>>
>> >>
>> >>
>> >>
>> >
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html?by-user=t>
>>
>> > Sent from the Users forum mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=3>
>> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=4>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=5>
>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=6>
>>
>>
>>
>> ------------------------------
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025865.html
>> To unsubscribe from How can I create RadioGroups that are not defined by
>> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>>
>>
>>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025955.html
> Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by tommy <to...@gmail.com>.
ok thanks, I'll try and put something together tonight. Are you able to
answer either of those questions?

On Wed, Nov 3, 2010 at 5:56 PM, Igor Vaynberg-2 [via Apache Wicket] <
ml-node+3025865-1659550532-201123@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> http://wicket.apache.org/start/quickstart.html
>
> -igor
>
> On Wed, Nov 3, 2010 at 9:03 AM, tommy <[hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=0>>
> wrote:
>
> >
> > Hi
> > Can you point me to a link that explains what a quickstart is and how I
> > create one?
> >
> > Also maybe you consider these questions
> >
> > 1. If I can pass in a RadioGroup object to a Radio() constructor does the
>
> > RadioGroup also need to be added to the page and if so, does it matter
> where
> > on the page the RadioGroup is rendered, and in both cases: why the need?
> > given that the Radio objects are now bound to the RadioGroup object
> > directly.
> >
> > 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
> > passed in to the Radio() constructor?
> >
> > Thanks, Tom
> >
> > On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3025865&i=1><[hidden
> email] <http://user/SendEmail.jtp?type=node&node=3025865&i=2>>
> >> wrote:
> >
> >> best way for us to help you is for you to create a quickstart and
> >> attach it to your email or a jira issue.
> >>
> >> -igor
> >>
> >> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
> >> wrote:
> >>
> >> >
> >> > I asked the following question on stack-overflow but was advised to
> ask
> >> here
> >> > instead.
> >> >
> >>
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
> >> >
> >> > I am using Wicket and would like to create a grid of radio buttons
> using
> >> > html as shown below (outer lists will be displayed vertically, inner
> >> lists
> >> > will be displayed horizontally).
> >> >
> >> > I would like the radio buttons grouped vertically.
> >> >
> >> > <ul>
> >> >  <li>
> >> >    <ul>
> >> >       <li><input type="radio" name="A"></li>
> >> >       <li><input type="radio" name="B"></li>
> >> >       <li><input type="radio" name="C"></li>
> >> >    </ul>
> >> >  </li>
> >> >  <li>
> >> >    <ul>
> >> >       <li><input type="radio" name="A"></li>
> >> >       <li><input type="radio" name="B"></li>
> >> >       <li><input type="radio" name="C"></li>
> >> >    </ul>
> >> >  </li>
> >> >  <li>
> >> >    <ul>
> >> >       <li><input type="radio" name="A"></li>
> >> >       <li><input type="radio" name="B"></li>
> >> >       <li><input type="radio" name="C"></li>
> >> >    </ul>
> >> >  </li>
> >> > </ul>
> >> >
> >> > Unfortunately it seems that RadioGroup only allow one to group radio
> >> buttons
> >> > according to the grouping defined by their layout.
> >> >
> >> > eg RadioGroup group = new RadioGroup("radioGroupA");
> >> >
> >> > group.add( new Radio("myradio", new Model(1)) ;
> >> >
> >> > Problem with this is that I cannot then layout the way I want.
> >> >
> >> > Is there another way? Manually specifying the name and gather results?
>
> >> >
> >> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So
> one
> >> can
> >> > do something like:
> >> >
> >> > // create some groups
> >> > for (0..n) {
> >> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>
> >> >  groupArray.add(group)
> >> > }
> >> >
> >> > //create a ListView for the RadioGroups so we can attach them to page
> >> > ListView radioListView = ListView("radioGroupList") { populate from
> >> > groupArray }
> >> > add(radioListView);
> >> >
> >> > // create our grid of radio buttons
> >> > // outer -> rows
> >> > for (0..x) {
> >> >  // inner -> columns
> >> >  for (0..n)
> >> >    // supply group from our groupArray
> >> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
> >> >  }
> >> > }
> >> >
> >> > I can then add the Radios and RadioGroups to the form independently of
>
> >> > layout and this has the desired effect in terms of the grouping.
> >> >
> >> > <form>
> >> >  < span wicket:id="radioGroupList">
> >> >     < span wicket:id="radioGroup"/>
> >> >  < /span>
> >> >  <ul>
> >> >    <li><radio wicket:id="myradio"/></li>
> >> >
> >> > But now, when I submit I am getting the following error:
> >> >
> >> > WicketMessage: submitted http post value [radio33] for RadioGroup
> >> component
> >> >
> >>
> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>
> >>
> >> > is illegal because it does not contain relative path to a Radio
> >> componnet.
> >> > Due to this the RadioGroup component cannot resolve the selected Radio
>
> >> > component pointed to by the illegal value. A possible reason is that
> >> > componment hierarchy changed between rendering and form submission.
> >> >
> >> > Any idea what this means?
> >> >
> >> > The spelling mistake 'componment' suggests it's not seen too often.
> >> >
> >> > I am using wicket 1.4.12.
> >> >
> >> > I found this ticket that looks related too :
> >> > https://issues.apache.org/jira/browse/WICKET-1055
> >> >
> >> > --
> >> > View this message in context:
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t>
> <
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t&by-user=t>>
>
> >> > Sent from the Users forum mailing list archive at Nabble.com.
> >> >
> >> > ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025609&i=1>
> >> > For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025609&i=2>
> >> >
> >> >
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025609&i=3>
> >> For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025609&i=4>
> >>
> >>
> >>
> >> ------------------------------
> >>  View message @
> >>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html?by-user=t>
> >> To unsubscribe from How can I create RadioGroups that are not defined by
>
> >> component hierarchy/layout ?, click here<
> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t>>.
>
> >>
> >>
> >>
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html?by-user=t>
>
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=3>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=4>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=5>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025865&i=6>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025865.html
> To unsubscribe from How can I create RadioGroups that are not defined by
> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025955.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by Igor Vaynberg <ig...@gmail.com>.
http://wicket.apache.org/start/quickstart.html

-igor

On Wed, Nov 3, 2010 at 9:03 AM, tommy <to...@gmail.com> wrote:
>
> Hi
> Can you point me to a link that explains what a quickstart is and how I
> create one?
>
> Also maybe you consider these questions
>
> 1. If I can pass in a RadioGroup object to a Radio() constructor does the
> RadioGroup also need to be added to the page and if so, does it matter where
> on the page the RadioGroup is rendered, and in both cases: why the need?
> given that the Radio objects are now bound to the RadioGroup object
> directly.
>
> 2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
> passed in to the Radio() constructor?
>
> Thanks, Tom
>
> On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
> ml-node+3025609-175919079-201123@n4.nabble.com<ml...@n4.nabble.com>
>> wrote:
>
>> best way for us to help you is for you to create a quickstart and
>> attach it to your email or a jira issue.
>>
>> -igor
>>
>> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
>> wrote:
>>
>> >
>> > I asked the following question on stack-overflow but was advised to ask
>> here
>> > instead.
>> >
>> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>> >
>> > I am using Wicket and would like to create a grid of radio buttons using
>> > html as shown below (outer lists will be displayed vertically, inner
>> lists
>> > will be displayed horizontally).
>> >
>> > I would like the radio buttons grouped vertically.
>> >
>> > <ul>
>> >  <li>
>> >    <ul>
>> >       <li><input type="radio" name="A"></li>
>> >       <li><input type="radio" name="B"></li>
>> >       <li><input type="radio" name="C"></li>
>> >    </ul>
>> >  </li>
>> >  <li>
>> >    <ul>
>> >       <li><input type="radio" name="A"></li>
>> >       <li><input type="radio" name="B"></li>
>> >       <li><input type="radio" name="C"></li>
>> >    </ul>
>> >  </li>
>> >  <li>
>> >    <ul>
>> >       <li><input type="radio" name="A"></li>
>> >       <li><input type="radio" name="B"></li>
>> >       <li><input type="radio" name="C"></li>
>> >    </ul>
>> >  </li>
>> > </ul>
>> >
>> > Unfortunately it seems that RadioGroup only allow one to group radio
>> buttons
>> > according to the grouping defined by their layout.
>> >
>> > eg RadioGroup group = new RadioGroup("radioGroupA");
>> >
>> > group.add( new Radio("myradio", new Model(1)) ;
>> >
>> > Problem with this is that I cannot then layout the way I want.
>> >
>> > Is there another way? Manually specifying the name and gather results?
>> >
>> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one
>> can
>> > do something like:
>> >
>> > // create some groups
>> > for (0..n) {
>> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>> >  groupArray.add(group)
>> > }
>> >
>> > //create a ListView for the RadioGroups so we can attach them to page
>> > ListView radioListView = ListView("radioGroupList") { populate from
>> > groupArray }
>> > add(radioListView);
>> >
>> > // create our grid of radio buttons
>> > // outer -> rows
>> > for (0..x) {
>> >  // inner -> columns
>> >  for (0..n)
>> >    // supply group from our groupArray
>> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
>> >  }
>> > }
>> >
>> > I can then add the Radios and RadioGroups to the form independently of
>> > layout and this has the desired effect in terms of the grouping.
>> >
>> > <form>
>> >  < span wicket:id="radioGroupList">
>> >     < span wicket:id="radioGroup"/>
>> >  < /span>
>> >  <ul>
>> >    <li><radio wicket:id="myradio"/></li>
>> >
>> > But now, when I submit I am getting the following error:
>> >
>> > WicketMessage: submitted http post value [radio33] for RadioGroup
>> component
>> >
>> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>>
>> > is illegal because it does not contain relative path to a Radio
>> componnet.
>> > Due to this the RadioGroup component cannot resolve the selected Radio
>> > component pointed to by the illegal value. A possible reason is that
>> > componment hierarchy changed between rendering and form submission.
>> >
>> > Any idea what this means?
>> >
>> > The spelling mistake 'componment' suggests it's not seen too often.
>> >
>> > I am using wicket 1.4.12.
>> >
>> > I found this ticket that looks related too :
>> > https://issues.apache.org/jira/browse/WICKET-1055
>> >
>> > --
>> > View this message in context:
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t>
>> > Sent from the Users forum mailing list archive at Nabble.com.
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=1>
>> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=2>
>> >
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=3>
>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=4>
>>
>>
>>
>> ------------------------------
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html
>> To unsubscribe from How can I create RadioGroups that are not defined by
>> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>>
>>
>>
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html
> Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by tommy <to...@gmail.com>.
Hi
Can you point me to a link that explains what a quickstart is and how I
create one?

Also maybe you consider these questions

1. If I can pass in a RadioGroup object to a Radio() constructor does the
RadioGroup also need to be added to the page and if so, does it matter where
on the page the RadioGroup is rendered, and in both cases: why the need?
given that the Radio objects are now bound to the RadioGroup object
directly.

2. Are there any examples of RadioGroup/Radio usage where RadioGroup is
passed in to the Radio() constructor?

Thanks, Tom

On Wed, Nov 3, 2010 at 3:54 PM, Igor Vaynberg-2 [via Apache Wicket] <
ml-node+3025609-175919079-201123@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> best way for us to help you is for you to create a quickstart and
> attach it to your email or a jira issue.
>
> -igor
>
> On Wed, Nov 3, 2010 at 4:40 AM, tommy <[hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=0>>
> wrote:
>
> >
> > I asked the following question on stack-overflow but was advised to ask
> here
> > instead.
> >
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
> >
> > I am using Wicket and would like to create a grid of radio buttons using
> > html as shown below (outer lists will be displayed vertically, inner
> lists
> > will be displayed horizontally).
> >
> > I would like the radio buttons grouped vertically.
> >
> > <ul>
> >  <li>
> >    <ul>
> >       <li><input type="radio" name="A"></li>
> >       <li><input type="radio" name="B"></li>
> >       <li><input type="radio" name="C"></li>
> >    </ul>
> >  </li>
> >  <li>
> >    <ul>
> >       <li><input type="radio" name="A"></li>
> >       <li><input type="radio" name="B"></li>
> >       <li><input type="radio" name="C"></li>
> >    </ul>
> >  </li>
> >  <li>
> >    <ul>
> >       <li><input type="radio" name="A"></li>
> >       <li><input type="radio" name="B"></li>
> >       <li><input type="radio" name="C"></li>
> >    </ul>
> >  </li>
> > </ul>
> >
> > Unfortunately it seems that RadioGroup only allow one to group radio
> buttons
> > according to the grouping defined by their layout.
> >
> > eg RadioGroup group = new RadioGroup("radioGroupA");
> >
> > group.add( new Radio("myradio", new Model(1)) ;
> >
> > Problem with this is that I cannot then layout the way I want.
> >
> > Is there another way? Manually specifying the name and gather results?
> >
> > UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one
> can
> > do something like:
> >
> > // create some groups
> > for (0..n) {
> >  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
> >  groupArray.add(group)
> > }
> >
> > //create a ListView for the RadioGroups so we can attach them to page
> > ListView radioListView = ListView("radioGroupList") { populate from
> > groupArray }
> > add(radioListView);
> >
> > // create our grid of radio buttons
> > // outer -> rows
> > for (0..x) {
> >  // inner -> columns
> >  for (0..n)
> >    // supply group from our groupArray
> >    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
> >  }
> > }
> >
> > I can then add the Radios and RadioGroups to the form independently of
> > layout and this has the desired effect in terms of the grouping.
> >
> > <form>
> >  < span wicket:id="radioGroupList">
> >     < span wicket:id="radioGroup"/>
> >  < /span>
> >  <ul>
> >    <li><radio wicket:id="myradio"/></li>
> >
> > But now, when I submit I am getting the following error:
> >
> > WicketMessage: submitted http post value [radio33] for RadioGroup
> component
> >
> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
>
> > is illegal because it does not contain relative path to a Radio
> componnet.
> > Due to this the RadioGroup component cannot resolve the selected Radio
> > component pointed to by the illegal value. A possible reason is that
> > componment hierarchy changed between rendering and form submission.
> >
> > Any idea what this means?
> >
> > The spelling mistake 'componment' suggests it's not seen too often.
> >
> > I am using wicket 1.4.12.
> >
> > I found this ticket that looks related too :
> > https://issues.apache.org/jira/browse/WICKET-1055
> >
> > --
> > View this message in context:
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html?by-user=t>
> > Sent from the Users forum mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=1>
> > For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=2>
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=3>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025609&i=4>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025609.html
> To unsubscribe from How can I create RadioGroups that are not defined by
> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025629.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by Igor Vaynberg <ig...@gmail.com>.
best way for us to help you is for you to create a quickstart and
attach it to your email or a jira issue.

-igor

On Wed, Nov 3, 2010 at 4:40 AM, tommy <to...@gmail.com> wrote:
>
> I asked the following question on stack-overflow but was advised to ask here
> instead.
> http://stackoverflow.com/questions/4074028/in-wicket-how-can-i-create-radiogroups-that-are-not-defined-by-component-hierarc
>
> I am using Wicket and would like to create a grid of radio buttons using
> html as shown below (outer lists will be displayed vertically, inner lists
> will be displayed horizontally).
>
> I would like the radio buttons grouped vertically.
>
> <ul>
>  <li>
>    <ul>
>       <li><input type="radio" name="A"></li>
>       <li><input type="radio" name="B"></li>
>       <li><input type="radio" name="C"></li>
>    </ul>
>  </li>
>  <li>
>    <ul>
>       <li><input type="radio" name="A"></li>
>       <li><input type="radio" name="B"></li>
>       <li><input type="radio" name="C"></li>
>    </ul>
>  </li>
>  <li>
>    <ul>
>       <li><input type="radio" name="A"></li>
>       <li><input type="radio" name="B"></li>
>       <li><input type="radio" name="C"></li>
>    </ul>
>  </li>
> </ul>
>
> Unfortunately it seems that RadioGroup only allow one to group radio buttons
> according to the grouping defined by their layout.
>
> eg RadioGroup group = new RadioGroup("radioGroupA");
>
> group.add( new Radio("myradio", new Model(1)) ;
>
> Problem with this is that I cannot then layout the way I want.
>
> Is there another way? Manually specifying the name and gather results?
>
> UPDATE: I notice that Radio can take a RadioGroup as a parameter. So one can
> do something like:
>
> // create some groups
> for (0..n) {
>  RadioGroup group = new RadioGroup("myRadioGroup", new Model { .. } );
>  groupArray.add(group)
> }
>
> //create a ListView for the RadioGroups so we can attach them to page
> ListView radioListView = ListView("radioGroupList") { populate from
> groupArray }
> add(radioListView);
>
> // create our grid of radio buttons
> // outer -> rows
> for (0..x) {
>  // inner -> columns
>  for (0..n)
>    // supply group from our groupArray
>    add( new Radio("myradio", new Model(1), groupArray.get(n) ));
>  }
> }
>
> I can then add the Radios and RadioGroups to the form independently of
> layout and this has the desired effect in terms of the grouping.
>
> <form>
>  < span wicket:id="radioGroupList">
>     < span wicket:id="radioGroup"/>
>  < /span>
>  <ul>
>    <li><radio wicket:id="myradio"/></li>
>
> But now, when I submit I am getting the following error:
>
> WicketMessage: submitted http post value [radio33] for RadioGroup component
> [2:tContainer:list:2:tPanel:myForm:orderedRadioGroupList:0:orderedRadioGroup]
> is illegal because it does not contain relative path to a Radio componnet.
> Due to this the RadioGroup component cannot resolve the selected Radio
> component pointed to by the illegal value. A possible reason is that
> componment hierarchy changed between rendering and form submission.
>
> Any idea what this means?
>
> The spelling mistake 'componment' suggests it's not seen too often.
>
> I am using wicket 1.4.12.
>
> I found this ticket that looks related too :
> https://issues.apache.org/jira/browse/WICKET-1055
>
> --
> View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025204.html
> Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by tommy <to...@gmail.com>.
If you look at the original html I showed you can see 3 groups called A, B,
C (I've included again below with values to make it clearer).

I want to be able to select one item from group A, one item from group B and
one item from group C. The number of groups will vary, eg sometimes it will
go to D or E or F etc.

Each group of radio buttons with the same name will be shown vertically, ie
All group A will be shown one on top of the other.

Each group has radios with the same set of values that (1..n).

The rows will show a slice across the groups where the values are the same
and some text at the end. a bit like this.

 A1  B1  C1   some text about 1
 A2  B2  C2   some text about 2
 A3  B3  C3   some text about 3

Your suggestion requires adding the radioButtons of the same group to a
parent object that represents the radio grouping. I dont see how you can do
this and at the same time, also have them as part of a ListView that groups
them by their value so I can display them as shown.

<ul>
  <li>
    <ul>
       <li><input type="radio" name="A" value="1"></li>
       <li><input type="radio" name="B" value="1"></li>
       <li><input type="radio" name="C" value="1"></li>
    </ul>
    some text
  </li>
  <li>
    <ul>
       <li><input type="radio" name="A" value="2" ></li>
       <li><input type="radio" name="B" value="2"></li>
       <li><input type="radio" name="C" value="2"></li>
          some text
    </ul>
  </li>
  <li>
    <ul>
       <li><input type="radio" name="A" value="3"></li>
       <li><input type="radio" name="B" value="3"></li>
       <li><input type="radio" name="C" value="3"></li>
         some text
    </ul>
  </li>
</ul>



On Wed, Nov 3, 2010 at 2:35 PM, Michael O'Cleirigh [via Apache Wicket] <
ml-node+3025457-596905818-201123@n4.nabble.com<ml...@n4.nabble.com>
> wrote:

> If you only need to select one Radio then one RadioGroup will work no
> matter how many nested radio's there are (the model object of the
> selected radio is assigned to the model object of the radio when the
> form submits)
>
> If you actually have different radio's (i.e. multiple selections are
> allowed) then using RadioChoice may make more sense.
>
> add (new ListView("listview") {
>
>     protected void populateItem(final ListItem<T> item);
>
>              item.add (rc = new RadioChoice("choice", new Model<T>(),
> choiceList));
>
>              rc.setPrefix("<li>");
>              rc.setSuffix("</li>");
>
>      }
> }
>
> <ul wicket:id="listview">
> <span wicket:id="choice">
> </ul>
>
> Not tested but it should work close to this way and cause each <select
> type="radio">...</select> to be wrapped in a <li></li> like you want.
>
> Mike
>
> > Ah but I have varying number of groups, hence the radioGroupList ( Sorry
> I
> > maybe didnt make this point clear enough). How can you nest them when you
>
> > dont know how many there will be?
> >
> > On Wed, Nov 3, 2010 at 1:46 PM, Tom Howe<[hidden email]<http://user/SendEmail.jtp?type=node&node=3025457&i=0>>
>  wrote:
> >
> >> Ah but I have varying number of groups, hence the radioGroupList ( Sorry
> I
> >> maybe didnt make this point clear enough). How can you nest them when
> you
> >> dont know how many there will be?
> >>
> >>
> >>
> >> On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket]<
>
> >> [hidden email] <http://user/SendEmail.jtp?type=node&node=3025457&i=1><[hidden
> email] <http://user/SendEmail.jtp?type=node&node=3025457&i=2>>
> >>> wrote:
> >>> Hi,
> >>>
> >>> The RadioGroup just needs to wrap the radio's in your markup.
>  Typically
> >>> it does not even render markup in the resultant page.
> >>>
> >>> Instead of this:
> >>>> <form>
> >>>>     <   span wicket:id="radioGroupList">
> >>>>        <   span wicket:id="radioGroup"/>
> >>>>     <   /span>
> >>>>     <ul>
> >>>>       <li><radio wicket:id="myradio"/></li>
> >>> do this:
> >>>
> >>> <form>
> >>> <span wicket:id="radioGroup">
> >>> <ul wicket:id="listview">
> >>> <li>  <radio wicket:id="myradio"/></li>
> >>> <  /span>
> >>> </form>
> >>>
> >>> add (rg = new RadioGroup("radioGroup"));
> >>>
> >>> rd.add (new ListView("listView") {...});
> >>>
> >>> This way the radio group will contain the Model Object of the Radio
> that
> >>> was selected by the user when the form submits.
> >>>
> >>> Regards,
> >>>
> >>> Mike
> >>>
> >>> ---------------------------------------------------------------------
> >>> To unsubscribe, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025272&i=0>
> >>> For additional commands, e-mail: [hidden email]<
> http://user/SendEmail.jtp?type=node&node=3025272&i=1>
> >>>
> >>>
> >>>
> >>> ------------------------------
> >>>   View message @
> >>>
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html<http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html?by-user=t>
> >>> To unsubscribe from How can I create RadioGroups that are not defined
> by
> >>> component hierarchy/layout ?, click here<
> http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==&by-user=t>>.
>
> >>>
> >>>
> >>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025457&i=3>
> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025457&i=4>
>
>
>
> ------------------------------
>  View message @
> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025457.html
> To unsubscribe from How can I create RadioGroups that are not defined by
> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>
>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025506.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
If you only need to select one Radio then one RadioGroup will work no 
matter how many nested radio's there are (the model object of the 
selected radio is assigned to the model object of the radio when the 
form submits)

If you actually have different radio's (i.e. multiple selections are 
allowed) then using RadioChoice may make more sense.

add (new ListView("listview") {

    protected void populateItem(final ListItem<T> item);

             item.add (rc = new RadioChoice("choice", new Model<T>(), 
choiceList));

             rc.setPrefix("<li>");
             rc.setSuffix("</li>");

     }
}

<ul wicket:id="listview">
<span wicket:id="choice">
</ul>

Not tested but it should work close to this way and cause each <select 
type="radio">...</select> to be wrapped in a <li></li> like you want.

Mike

> Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
> maybe didnt make this point clear enough). How can you nest them when you
> dont know how many there will be?
>
> On Wed, Nov 3, 2010 at 1:46 PM, Tom Howe<to...@artcore.com>  wrote:
>
>> Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
>> maybe didnt make this point clear enough). How can you nest them when you
>> dont know how many there will be?
>>
>>
>>
>> On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket]<
>> ml-node+3025272-1259231181-201123@n4.nabble.com<ml...@n4.nabble.com>
>>> wrote:
>>> Hi,
>>>
>>> The RadioGroup just needs to wrap the radio's in your markup.  Typically
>>> it does not even render markup in the resultant page.
>>>
>>> Instead of this:
>>>> <form>
>>>>     <   span wicket:id="radioGroupList">
>>>>        <   span wicket:id="radioGroup"/>
>>>>     <   /span>
>>>>     <ul>
>>>>       <li><radio wicket:id="myradio"/></li>
>>> do this:
>>>
>>> <form>
>>> <span wicket:id="radioGroup">
>>> <ul wicket:id="listview">
>>> <li>  <radio wicket:id="myradio"/></li>
>>> <  /span>
>>> </form>
>>>
>>> add (rg = new RadioGroup("radioGroup"));
>>>
>>> rd.add (new ListView("listView") {...});
>>>
>>> This way the radio group will contain the Model Object of the Radio that
>>> was selected by the user when the form submits.
>>>
>>> Regards,
>>>
>>> Mike
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025272&i=0>
>>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025272&i=1>
>>>
>>>
>>>
>>> ------------------------------
>>>   View message @
>>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html
>>> To unsubscribe from How can I create RadioGroups that are not defined by
>>> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>>>
>>>
>>>


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


Re: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by tommy <to...@gmail.com>.
Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
maybe didnt make this point clear enough). How can you nest them when you
dont know how many there will be?

On Wed, Nov 3, 2010 at 1:46 PM, Tom Howe <to...@artcore.com> wrote:

> Ah but I have varying number of groups, hence the radioGroupList ( Sorry I
> maybe didnt make this point clear enough). How can you nest them when you
> dont know how many there will be?
>
>
>
> On Wed, Nov 3, 2010 at 12:38 PM, Michael O'Cleirigh [via Apache Wicket] <
> ml-node+3025272-1259231181-201123@n4.nabble.com<ml...@n4.nabble.com>
> > wrote:
>
>> Hi,
>>
>> The RadioGroup just needs to wrap the radio's in your markup.  Typically
>> it does not even render markup in the resultant page.
>>
>> Instead of this:
>> > <form>
>> >    <  span wicket:id="radioGroupList">
>> >       <  span wicket:id="radioGroup"/>
>> >    <  /span>
>> >    <ul>
>> >      <li><radio wicket:id="myradio"/></li>
>>
>> do this:
>>
>> <form>
>> <span wicket:id="radioGroup">
>> <ul wicket:id="listview">
>> <li> <radio wicket:id="myradio"/></li>
>> < /span>
>> </form>
>>
>> add (rg = new RadioGroup("radioGroup"));
>>
>> rd.add (new ListView("listView") {...});
>>
>> This way the radio group will contain the Model Object of the Radio that
>> was selected by the user when the form submits.
>>
>> Regards,
>>
>> Mike
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025272&i=0>
>> For additional commands, e-mail: [hidden email]<http://user/SendEmail.jtp?type=node&node=3025272&i=1>
>>
>>
>>
>> ------------------------------
>>  View message @
>> http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025272.html
>> To unsubscribe from How can I create RadioGroups that are not defined by
>> component hierarchy/layout ?, click here<http://apache-wicket.1842946.n4.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=3025204&code=dG9tbXl0YXN0aWNAZ21haWwuY29tfDMwMjUyMDR8MTM3MjA2NTU0MQ==>.
>>
>>
>>
>

-- 
View this message in context: http://apache-wicket.1842946.n4.nabble.com/How-can-I-create-RadioGroups-that-are-not-defined-by-component-hierarchy-layout-tp3025204p3025394.html
Sent from the Users forum 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: How can I create RadioGroups that are not defined by component hierarchy/layout ?

Posted by Michael O'Cleirigh <mi...@rivulet.ca>.
Hi,

The RadioGroup just needs to wrap the radio's in your markup.  Typically 
it does not even render markup in the resultant page.

Instead of this:
> <form>
>    <  span wicket:id="radioGroupList">
>       <  span wicket:id="radioGroup"/>
>    <  /span>
>    <ul>
>      <li><radio wicket:id="myradio"/></li>

do this:

<form>
<span wicket:id="radioGroup">
<ul wicket:id="listview">
<li> <radio wicket:id="myradio"/></li>
< /span>
</form>

add (rg = new RadioGroup("radioGroup"));

rd.add (new ListView("listView") {...});

This way the radio group will contain the Model Object of the Radio that 
was selected by the user when the form submits.

Regards,

Mike

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