The trick is normally to name the "id" used in the <logic:iterate> to
the same name as the property for your "list of product" in your
ActionForm (i.e. newProducts in your example):
<logic:iterate id="newProducts" property="newProducts">
<html:text name="newProducts" property="name" indexed="true" />
</logic:iterate>
Which should then produce the html you're expecting:
<input type="text" name="newProducts[0].name" />
Niall
On 10/23/06, Puneet Lakhina <[EMAIL PROTECTED]> wrote:
Hi,
I have some objects in an Array List which I want to fetch using indexed
properties. So basically in my array list I have objects of type Product,
which has properties like name,number etc. with appropriate getter and
setter methods.
What I am unable to figure out is the following.
<logic:iterate name="list" id="foo" indexId="ctr">
<html:text property="newProducts.name" indexed="true" />
</logic:iterate>
The indexed attribute mentioned in the html text. Does it make newProducts
indexed or does it make name indexed. I mean what do i do to get
<input type="text" name="newProducts[0].name" />
and so on...
I know I could you use scriptlets, but I was thinking if there was a cleaner
solution to the whole thing.
Thanks
--
Puneet
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]