Just tried it out and it does not work. My code look like this:
I am using indexted='true' in my JSP file so an element looks like: <html:text name="element" property="addressLine1" size="20" value="" maxlength="35" indexed="true"/> The rendered JSP looks like: <input type="text" name="element[0].addressLine1" maxlength="35" size="20" value="Addr one"> My validation XML looks like: <form name="AddressForm"> <field property="addressLine1" indexedListProperty="element" depends="required"> <msg name="required" key="label.error.address.required"/> </field> </form> Also, keeping in mind that I have 10 address fields which are required only if the fields are visible (it is a show hide kind of thing using JavaScript), is this even a good way to go in my case. Or should I just go ahead and build a custom validator. Harsh. -----Original Message----- From: Niall Pemberton [mailto:[EMAIL PROTECTED] Sent: Friday, February 09, 2007 4:35 AM To: Struts Users Mailing List Subject: Re: Validating list backed struts form Specify the property in your form which returns the list of addresses using the "indexedListProperty" element in your validation.xml - "property" is then the property of a bean in that list. Something like: <form name="Customer"> <field property="city" indexedListProperty="addressList" depends="required"> ... </field> <field property="state" indexedListProperty="addressList" depends="required"> ... </field> </form> Niall On 2/8/07, Chaudhary, Harsh <[EMAIL PROTECTED]> wrote: > Hi, > > I am trying to validate a form which has an arraylist of Address > objects. I would like some pointers on this or any references etc. > > Harsh. > --------------------------------------------------------------------- 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]