You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ma...@j-b-s.de on 2008/03/14 10:16:27 UTC
[T5] RadioGroup and varible numbers of radio buttons
Hi!
I have a problem to handle a radiogroup having a variable number of radio buttons created within a loop.
The 'tml' looks basically like the following code snippet:
<t:radiogroup t:id="addressSelector">
<t:loop source="addresses" value="loopAddress">
<tr>
<td><t:radio t:id="radio" value="${loopAddress.userId}"/>${loopAddress.userId}</td>
<td xml:space="preserve">${loopAddress.firstName} ${loopAddress.lastName}</td>
</tr>
</t:loop>
</t:radiogroup>
this works just fine.
After adding a additional radio button outside the loop Tapestry complains that the component with the id "radio" already exists?
<t:radiogroup t:id="addressSelector">
<t:loop source="addresses" value="loopAddress">
<tr>
<td><t:radio t:id="radio" value="${loopAddress.userId}"/>${loopAddress.userId}</td>
<td xml:space="preserve">${loopAddress.firstName} ${loopAddress.lastName}</td>
</tr>
</t:loop>
<td colspan="2"><t:radio t:id="radio" value="NEW ADDRESS"/></td>
</t:radiogroup>
What is the difference to the loop?
So as a workaround I added an empty entry to the address list and preserved the layout by using <t:if> blocks but I really do not understand why this is not working.
Any ideas?
Thanks in advance
Jens
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: [T5] RadioGroup and varible numbers of radio buttons
Posted by Stephane Decleire <sd...@cariboo-networks.com>.
You use the id "radio" 2 times in the same tml page. That's not allowed.
Stephane
mailinglist@j-b-s.de a écrit :
> Hi!
>
> I have a problem to handle a radiogroup having a variable number of radio buttons created within a loop.
> The 'tml' looks basically like the following code snippet:
>
> <t:radiogroup t:id="addressSelector">
> <t:loop source="addresses" value="loopAddress">
> <tr>
> <td><t:radio t:id="radio" value="${loopAddress.userId}"/>${loopAddress.userId}</td>
> <td xml:space="preserve">${loopAddress.firstName} ${loopAddress.lastName}</td>
> </tr>
> </t:loop>
> </t:radiogroup>
>
> this works just fine.
>
> After adding a additional radio button outside the loop Tapestry complains that the component with the id "radio" already exists?
>
> <t:radiogroup t:id="addressSelector">
> <t:loop source="addresses" value="loopAddress">
> <tr>
> <td><t:radio t:id="radio" value="${loopAddress.userId}"/>${loopAddress.userId}</td>
> <td xml:space="preserve">${loopAddress.firstName} ${loopAddress.lastName}</td>
> </tr>
> </t:loop>
> <td colspan="2"><t:radio t:id="radio" value="NEW ADDRESS"/></td>
> </t:radiogroup>
>
> What is the difference to the loop?
> So as a workaround I added an empty entry to the address list and preserved the layout by using <t:if> blocks but I really do not understand why this is not working.
>
> Any ideas?
>
> Thanks in advance
>
> Jens
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>