You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Chris Cheshire <ch...@gmail.com> on 2006/03/14 22:12:42 UTC

Re: using the indexId value of iterate in a radio button (SOLVED)

OK I was making this to be way harder than it needed to be.

<logic:iterate id="paymentSource" indexId="idx" name="sessionInfo"
property="paymentSources" scope="session">
    <tr>
        <td class="grey" width="10" nowrap><html:radio
property="paymentSourceId" value="${idx}" /></td>
    </tr>
</logic:iterate>

Was all I needed.

Chris

On 3/14/06, Chris Cheshire <ch...@gmail.com> wrote:
> I have a collection of PaymentSource objects (credit cards, debit
> accounts) stored in an object in the session. I want to iterate
> through these, presenting a radio button and the masked version of the
> account number on the page.
>
> I want to have the value of the radio button the index in the
> collection, not the value of the account number itself (which is the
> unique identifier of the objects) for data security reasons.
> Unfortunately the value tag of html:radio wants a bean property of the
> payment source.
>
> How can I get  it to use the exposed indexId bean from the logic:iterate tag?
>
> I have
>
> <logic:iterate id="paymentSource" indexId="idx" name="sessionInfo"
> property="paymentSources" scope="session">
>             <tr>
>               <td class="grey" width="10" nowrap><html:radio
> idName="paymentSource" property="paymentSourceId" value="idx" /></td>
>             </tr>
> </logic:iterate>
>
>
> But it is looking for the property idx under paymentSource. Is there
> any way to do this? The properties  of PaymentSource don't include
> anything that is unique and not sensitive.
>
> Thanks
>
> Chris
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org