A
apaeth
I'm using struts 1.2.7 and I've got what seems like should be a rather
simple task to complete. I've got a form that lists an arbitrary
number of items in rows. I'm iterating through a collection to
generate this list, so I'm using the indexed attribute on all the html
elements.
<html:form action="/DoFileStuff">
....
<logic:iterate id="file" name="folder" property="newFiles"
type="foo.FileLister">
....
<html:text name="fileStuffForm" property="extinfo" indexed="true"/>
....
</logic:iterate>
....
</html:form>
the text box gets the name "fileStuffForm[0].extinfo" which I believe
is correct. The struts config for this form looks something like this.
<form-bean name="fileStuffForm" dynamic="true" >
<form-property name="extinfo" type="java.lang.String[]" />
</form-bean>
...
<action path="/DoFileStuff"
name="fileStuffForm"
type="foo.ProcessFileRequestAction">
<forward name="success" path=".view.Files"/>
</action>
I've discovered that the property name in the DynaValidatorForm ends up
being extinfo and it shows that it contains a String[], but the array
always ends up being empty. I know that this works correctly using a
non-indexed html element and I'd just switch to getting the values
directly out of the request since I know what the name is, but I want
to be able to use the validation built into the form.
Thanks in advance for any help,
A Paeth
simple task to complete. I've got a form that lists an arbitrary
number of items in rows. I'm iterating through a collection to
generate this list, so I'm using the indexed attribute on all the html
elements.
<html:form action="/DoFileStuff">
....
<logic:iterate id="file" name="folder" property="newFiles"
type="foo.FileLister">
....
<html:text name="fileStuffForm" property="extinfo" indexed="true"/>
....
</logic:iterate>
....
</html:form>
the text box gets the name "fileStuffForm[0].extinfo" which I believe
is correct. The struts config for this form looks something like this.
<form-bean name="fileStuffForm" dynamic="true" >
<form-property name="extinfo" type="java.lang.String[]" />
</form-bean>
...
<action path="/DoFileStuff"
name="fileStuffForm"
type="foo.ProcessFileRequestAction">
<forward name="success" path=".view.Files"/>
</action>
I've discovered that the property name in the DynaValidatorForm ends up
being extinfo and it shows that it contains a String[], but the array
always ends up being empty. I know that this works correctly using a
non-indexed html element and I'd just switch to getting the values
directly out of the request since I know what the name is, but I want
to be able to use the validation built into the form.
Thanks in advance for any help,
A Paeth