If you have a collection like an ArrayList, every element has an index.  At
each of these element addresses, you have another ArrayList.  With Struts,
if you iterate through the parent collection based on the indexId (first
element = 0, last element = n-1), you can retrieve the contents of each
collection stored at the element index of the collection automatically:

<logic:iterate name="parentCollection"
               property="parentProperty"
               indexId="parentIndex"  //arbitrary name
               id="parent"            //arbitrary name
               type="java.util.List">
  <logic:iterate name="parent"
                 property="childProperty"
                 indexId="childIndex"  //arbitrary name
                 id="child"            //arbitrary name
                 type="java.util.List">
    <bean:write name="child" property="_whatever_" />
    // etc.
  </logic:iterate>
</logic:iterate>


Mark

-----Original Message-----
From: Cohan, Sean [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, January 14, 2003 11:08 AM


Excuse my naivet�, how would I refer to collection within a collection?
Thanks



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to