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] <
[email protected]<ml-node%[email protected]>
> 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: [email protected]
For additional commands, e-mail: [email protected]