Re: iteration with indexed properties
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] : [rendered html] : [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]
Re: iteration with indexed properties
martin 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. You might want to look at using the html:nested tag. It will make things easier. Or you can use JSTL. I show both ways in this paste.. http://www.pastehere.com/?imwwgb You can see a full example here... http://www.learntechnology.net/struts-nested.do -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: iteration with indexed properties
Interesting! How did tip.scoreHome render as tip.guessedScoreHome ? On 4/23/06, martin <[EMAIL PROTECTED]> wrote: > 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] > property="wrappers" scope="session"> > > size="1" maxlength="2" /> : > indexed="true" size="1" maxlength="2" /> > > > > [rendered html] > > maxlength="2" size="1" value="23"> : > maxlength="2" size="1" value=""> > > > [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] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
iteration with indexed properties
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] : [rendered html] : [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]