Hi all,
for first sorry for my english.
I've a complex Form where I need to bind nested objects into the master model attribute.
I mean: I've a Form to handle a "Contract" data, in this Form I can add multiple "Contract conditions" and each "Condition" has multiple "Condition details".
So a "Contract" has a property with a collection of "conditions" and each "condition" has a a property with a collection of "details".
The tables relationship and corresponding hierarchy of java classes are corrects but I don't know how to bind nested objects into the "Contract" ModelAttribute.
I don't know ho to us PropertyEditors to handle this situation.
If I have an input form link this:
Property Editor for "Condition" objects is not triggered.Code:<input type="text" name="conditions[0].fromDate" />
If I write only:
It works but I need to set each property of that condition.Code:<input type="text" name="conditions[0]" />
I need to create N conditions:
How can I catch a "conditions[n].property" in POST data and bind it into the Model Attribute?Code:<input type="text" name="conditions[0].fromDate" /> <input type="text" name="conditions[0].toDate" /> <input type="text" name="conditions[0].description" /> <input type="text" name="conditions[1].fromDate" /> <input type="text" name="conditions[1].toDate" /> <input type="text" name="conditions[1].description" /> ....
Thanks a lot.


Reply With Quote