you need to have an instantiated array of wrapper[] that is big enough
to take what your HTML submits. If your action form is in the request,
then wrappers[] will be null unless you instantiate it.
martin on 23/04/06 16:59, wrote:
I've a problem with indexed properties inside an iteration. Some of the
properties are rendered as a text-area and should be editable by the
user. The rendering goes fine but if the user makes some changes, they
are not committed to the form. Please take a look at the jsp/html/java
snippets below.
[snip]
[jsp snippet]
<logic:iterate id="wrapper" indexId="wrapperIndex" name="myForm"
property="wrappers" scope="session">
<td class="">
<html:text name="wrapper" property="tip.scoreHome" indexed="true"
size="1" maxlength="2" /> :
<html:text name="wrapper" property="tip.scoreVisitor"
indexed="true" size="1" maxlength="2" />
</td>
</logic:iterate>
[rendered html]
<td class="">
<input type="text" name="wrapper[2].tip.guessedScoreHome"
maxlength="2" size="1" value="23"> :
<input type="text" name="wrapper[2].tip.guessedScoreVisitor"
maxlength="2" size="1" value="">
</td>
[action form snippet]
public void setWrappers(GameTipWrapper[] wrappers) {
this.wrappers = wrappers;
}
public GameTipWrapper getWrapper(int index) {
return wrappers[index];
}
public void setWrapper(int index, GameTipWrapper wrapper) {
wrappers[index] = wrapper;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]