Wendy Smoak wrote the following on 7/12/2005 7:12 PM:
From: "Jörg Eichhorn" <[EMAIL PROTECTED]>

i have a form bean with a list property of complex object which also
contains a list of objects. When iterating over the first list and using
indexed elements, then values of the first list are transferred back when
submitting the form. The values of the inner list is displayed correctly
but is not transmitted back on submit.


I think you need to use the nested taglib for this:
   http://struts.apache.org/userGuide/dev_nested.html


You can do this without using the nested tags, but the nested tags make it much cleaner. Here's an example from a demo app that I keep meaning to post to show how it can be done using either the nested or regular JSTL tags...

Company has divisions and in each division there is a list of departments with names.

<%-- JSTL way --%>

<c:forEach items="${companyForm.divisions}" var="division" varStatus="divstatus"> Division: <html:text property="divisions[${divstatus.index}].name" value="${division.name}" /><br> <c:forEach items="${division.departments}" var="department" varStatus="depstatus"> --- Department: <html:text property="divisions[${divstatus.index}].departments[${depstatus.index}].name" value="${department.name}" /><br>
    </c:forEach>
</c:forEach>


<%-- Nested tag way --%>

<nested:root name="companyForm">
  <nested:iterate property="divisions">
    Division: <nested:text property="name" /><br>
        <nested:iterate property="departments">
        --- Department: <nested:text property="name" /><br>
        </nested:iterate>
  </nested:iterate>
</nested:root>



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

Reply via email to