You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ankur Gupta <an...@comcast.net> on 2004/08/12 18:17:04 UTC

Nested Lists

Hello,

I have a list of passengers in a form and each passenger contains a list of
addresses. How do I map this scenario in Struts?


 <logic:iterate id="passenger" name="addOnHandForm" property="passengerList"
indexId="i"   type="com.bagnet.nettracer.tracing.db.OHD_Passenger">     
	<tr> 
      	<td><bean:message key="colname.first_name"/>: 
                      <html:text name="passenger" property="firstname"
size="14" maxlength="20" indexed="true"/> 
            </td>
	</tr>
	<logic:present name="passenger" property="addresses">

      	<logic:iterate indexId="k" name="passenger" id="addresses"
property="addresses" type="com.bagnet.nettracer.tracing.db.OHD_Address">
                       <tr> 
                        <td>  
	
<bean:messagekey="colname.street_addr"/>:
                        </td>
                        <td> 
                          <html:text name="addresses" property="address1"
size="25" maxlength="50" indexed="true"/> 
                        </td>
                      </tr>
		</logic:iterate>
	</logic:present>
</logic:iterate>

I have it structured like above. But, having difficulty saving the values
for address. Basically, what I want to know is how to provide the right name
for html text field for address1. What getter method should there be in the
addOnHandForm? For nested lists to work??

Thanks,

Ankur


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