> -----Original Message-----
> From: Kashambuzi, Michael (C)
> Sent: Tuesday, June 04, 2002 9:41 AM
> To: 'Struts Users Mailing List'
> Subject: Indexed Property Validation on a String[]
>
> Hi:
>
> I have a form bean that contains an attribute defined as a String[].
>
> public class MyFormBean
> {
> String[] options = new String[100];
>
> public void setOptions(String[] options)
> {
> this.options = options;
> }
>
> public String[] getOptions()
> {
> return options;
> }
> }
>
> I want to be able to display all 100 options in a JSP using the iterate
> tag. Let's assume that my form bean is stored in the session scope under
> the attribute named myFormBean.
>
> <logic:iterate id="anOption" name="myFormBean" property="options"
> indexId="index">
>
> <html:text indexed="true" name="anOption" property='?????'
> size="2"/>
>
> <% if ( (index.intValue()+1) % 10 == 0 ) %>
> <br>
>
> </logic:iterate>
>
> What should be filled in for the property since "anOption" is a String?
>
>
> Next, I need to set up a field validation in validation.xml. From the
> following URL,
>
> http://home.earthlink.net/~dwinterfeldt/revision.html
>
> a suggestion is made to use the following:
>
> <logic:iterate id="listElement" name="registrationForm"
> property="listElementList" indexId="index">
> <html:textarea indexed="true" name="listElement"
> property="value" cols="60" rows="8"/><br>
> </logic:iterate>
>
> <field property="value"
> indexedProperty="listElement"
> indexedListProperty="listElementList"
> depends="required">
> <arg0 key="registrationForm.paragraph.displayname"/>
> </field>
>
> So far, I have the following:
>
> <field property="?????"
> indexedProperty="anOption"
> indexedListProperty="options"
> depends="required">
> <arg0 key="label.optionLabel"/>
> </field>
>
> What should be filled in for the property since "anOption" is a String?
>
> Any help that anyone can provide will be greatly appreciated!
>
> Thanks in advance.
>
> Michael
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>