struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Karr, David" <david.k...@attws.com>
Subject RE: Accessing a collection in a Form bean with <html:options>
Date Mon, 21 Oct 2002 18:50:20 GMT
> -----Original Message-----
> From: Itagaki, Masaki [mailto:Masaki_Itagaki@jdedwards.com]
> Sent: Monday, October 21, 2002 11:45 AM

> This is just fine. Now, I have another AddressForm member of 
> a string array
> for multiple phone numbers, as "phones" (String[]) and need 
> to display as a
> dropdown in the table. All I could do was as follows:
> 
> <logic:iterate id="ad" type="com.[fullpath].AddressForm" 
> name="s_addresses">
> <tr>
> <td>
> <bean:write name="ad" property="name"/>
> </td>
> <td>
> <bean:write name="ad" property="address"/>
> </td>
> <td>
> <!-- Phone dropdown -->
> <bean:define id="telephones" property="phones" scope="request"/>
> <html:select property="phonelist">
>   <html:options collection="telephones" property="digits"
> labelProperty="number"/>
> <html:select>
> <!-- ----------------->
> </td>
> </tr>
> </logic:iterate>

I think your "bean:define" element needs to reference the bean created in
your loop.  Try the following:

<bean:define id="telephones" name="ad" property="phones" scope="request"/>

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


Mime
View raw message