struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From martin <mar...@cochabamba.ch>
Subject iteration with indexed properties
Date Sun, 23 Apr 2006 15:59:25 GMT
Hello

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.

I'm using Java 5 with Stuts 1.2.9 in a Tomcat 5.5.16

Every hint is appreciated
Cheers Martin




[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" />&nbsp;:&nbsp;
    <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">&nbsp;:&nbsp;
    <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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message