Hi all,
Using Struts 1.1.
I have an ActionForm in which displays an array of items. I want to use
DynaValidatorForm here which uses ArrayList as property holders. I am able
to pre-populate the form. I have trouble in displaying the values and on
submission nothing is populated. If somebody can give an example it will be
very useful to me.
Struts-config.xml
------------------
<form-bean name="PriceForm"
type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="productid" type="java.util.ArrayList"/>
<form-property name="productdesc" type="java.util.ArrayList"/>
</form-bean>
JSP
---
logic:iterate name="PriceForm" property="productid" id="pid"
indexId="index">
<tr>
<//html:hidden property='<%="productid["+index+"]"%>'/>
<td><html:text property="productdesc" indexed="true"/>
<td><//html:text property='<%="productdesc["+index+"]"%>'/>
</tr>
</logic:iterate>
I tried using indexed attribute. Then HTML generated is
<input type="text" name="org.apache.struts.taglib.html.BEAN[0].productdesc"
value="[product desc 0]">
See the value is in braces.
If I use <html:text property="productdesc" indexed="true"/> I get
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
What is wrong ?.
rgds
Antony Paul
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]