You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Deshmukh, Prabodh (P.)" <pd...@ford.com> on 2005/11/07 19:40:45 UTC

Lists within lists issue

Hi,

I have an object that contains a list of sub-objects. These sub-objects
hold another list (say sub-list) )of sub-sub-objects:
object->list->sub-object->sub-list->sub-sub-object->property.

I am displaying various properties of the sub-sub-object - which can be
changed by the user - I want struts to fire the appropriate setters when
these properties are changed.

Here is how the jsp loop looks like:
<logic:iterate name="object" property="list" id="sub-object" type="..">
  <tr><td>
  <logic:iterate name="sub-object" property="sub-list"
id="sub-sub-object" type ="..">
    <html:textarea name="sub-sub-object" property="property"
indexed="true"/>
  </logic:iterate>
  </td></tr>
</logic:iterate>

I am able to display the "property" of the "sub-sub-object" - but when
the user changes the above text area, sub-sub-object.property - doesn't
get updated.

The html comes out as:
<tr><td>
   <textarea name="sub-sub-object[0].property">
   </textarea>
</td></tr>
<tr><td>
   <textarea name="sub-sub-object[1].property">
   </textarea>
</td></tr>
...

I want the html to be like:
<tr><td>
   <textarea name="sub-object[0].sub-sub-object[0].property">
   </textarea>
</td></tr>
<tr><td>
   <textarea name="sub-object[0].sub-sub-object[1].property">
   </textarea>
</td></tr>
...
<tr><td>
   <textarea name="sub-object[1].sub-sub-object[0].property">
   </textarea>
</td></tr>
<tr><td>
   <textarea name="sub-object[1].sub-sub-object[1].property">
   </textarea>
</td></tr>
...

This will enable struts to fire appropriate object setters.

Constraints: struts1.1 without struts-el tag library.

Any idea of how I can accomplish this? 

I will appreciate any responses.

Prabodh Deshmukh.

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