Davide,
Maybe I am doing something wrong but I have had problems getting indexed =true to work for arrays on the form -- it works correctly for arrays of a nested property of form.
For example, if I were to use what you suggested I get something like:
<br/><input type="text" name="org.apache.struts.taglib.html.BEAN[0].answer" value="[Ljava.lang.String;@487c5f">
<br/><input type="text" name="org.apache.struts.taglib.html.BEAN[1].answer" value="[Ljava.lang.String;@487c5f">
<br/><input type="text" name="org.apache.struts.taglib.html.BEAN[2].answer" value="[Ljava.lang.String;@487c5f">
When what I want is:
<br/><input type="text" name="answer[0]" value="foo">
<br/><input type="text" name="answer[1]" value="bar">
<br/><input type="text" name="answer[2]" value="baz">
I am doing something wrong?
Davide Gurgone wrote:
Bill Siggelkow wrote:
You will need to add indexed getters and setters --
public String getAnswer(int index); public String setAnswer(int index, String value);
<logic:iterate name="questionForm" property="answers" id="answer" indexId="ctr"> <br/><html:text property=’<%="answer["+ctr+"]"%>’/> </logic:iterate>
Better :) [CUT] <html:text property="answers" indexed="true" /> [CUT] it render a property named property[0], property[1], etc
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]