I know there has been talk around this subject, if it hasn't been addressed
directly, but I can't seem to find the answer that will work.
My problem:
I have a bean (instance of an ActionForm), lets call it OrderForm. It has an
ArrayList of LineItem objects, and each LineItem contains ArrayList of
Detail objects (the Detail contains shipping information...I allow a
LineItems to be split to multiple shipping addresses...). I can successfully
itterate over and display the contents of this nested structure, but the
problems comes into play when I want to update the contents of the Detail or
LineItem objects. Note: it is no problem to update the simple String
properties of the OrderForm itself.
I simple don't know how to name the <input> properties such that the
BeanUtils class can set the values for me... Below is my approach (all
layout details left off and otherwise simplified...):
...
Some Order Property: <html:text name="orderForm"
property="someOrderProperty" size="50" />
...
<logic:iterate id="lineItem" name="orderForm" property="lineItems">
Some Line Item Property: <html:text name="lineItem"
property="someLineItemProperty" size="xxx" />
...
<logic:iterate id="detail" name="lineItem" property="details">
Some Detail Property: <html:text name="detail"
property="someDetailProperty" size="xxx" />
...
</logic:iterate>
</logic:iterate>
...
The code above renders on the page perfectly, but when I make a change to
one of the detail or lineItem properties they don't make it to the nested
objects... I understand that the names of the text <input> parameters that
are generated with the above code will not give the BeanUtils class a chance
in hell of setting the nested values for me, but I am at a loss for how to
approach this.......
Any ideas??? Or can someone point me to an email that has already answered
this question???
Thanks,
Troy