You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jack Nuzbit <fn...@googlemail.com> on 2009/11/06 17:18:41 UTC

[T5] radio group inside loop

Hi All,
I'm having trouble getting a radiogroup to work as I expect inside a loop.
This is what I have tried:

<t:loop source="myObjects" value="myValue" encoder="myEncoder">
    <t:radiogroup value="myValue.status">
        <t:radio value="statusA"/>
        <t:radio value="statusB"/>
    </t:radiogroup>
</t:loop>

The status variable I want to be selectable is an int and I have
corresponding public methods for statusA and statusB that return different
int values.

But this throws a NullPointerException (at
org.apache.tapestry5.corelib.components.RadioGroup.setupRender(RadioGroup.java:176)).

Can anyone shed any light on what I'm doing wrong?

Many thanks

Jack

Re: [T5] radio group inside loop

Posted by Jack Nuzbit <fn...@googlemail.com>.
I hang my head in shame. I hadn't yet put in any t:form tags so the
radiogroup had no formsupport object.


On Fri, Nov 6, 2009 at 4:18 PM, Jack Nuzbit <fn...@googlemail.com> wrote:

> Hi All,
> I'm having trouble getting a radiogroup to work as I expect inside a loop.
> This is what I have tried:
>
> <t:loop source="myObjects" value="myValue" encoder="myEncoder">
>     <t:radiogroup value="myValue.status">
>         <t:radio value="statusA"/>
>         <t:radio value="statusB"/>
>     </t:radiogroup>
> </t:loop>
>
> The status variable I want to be selectable is an int and I have
> corresponding public methods for statusA and statusB that return different
> int values.
>
> But this throws a NullPointerException (at
> org.apache.tapestry5.corelib.components.RadioGroup.setupRender(RadioGroup.java:176)).
>
> Can anyone shed any light on what I'm doing wrong?
>
> Many thanks
>
> Jack
>
>
>
>
>