What do you mean when you say it doesn't work?  
I compared your code with something I have that's working and they
look pretty much the same.  I have a form with a list of employees,
and each employee has fields such as "birth".

The HTML form looks something like this:
<nested:iterate property="employees">     
        <nested:text property="birth" size="10" maxlength="10"/>
        <nested:text property="ssNumber" size="9" maxlength="9"/>
        <nested:text property="salary" size="12"/>
    </TR>
</nested:iterate>

Validation rules look like this:

            <field property="birth" indexedListProperty="employees"
depends="required,date">
                <arg0 key="employeeform.birth.displayname"/>
                <var>
                    <var-name>datePatternStrict</var-name>
                    <var-value>MM/dd/yyyy</var-value>
                </var>
            </field>
            <field property="ssNumber" indexedListProperty="employees"
                     depends="required,integer">
                <arg0 key="employeeform.ssnumber.displayname"/>
            </field>
            <field property="salary" indexedListProperty="employees" 
                     depends="required,mask">
                <arg0 key="employeeform.salary.displayname"/>
                <var>
                    <var-name>mask</var-name>
                    <var-value>^\$?\d+(,\d{3})*(\.\d{2})?$</var-value>
                </var>
            </field>

This app is using Struts 1.2, though.  If you want to try it out, it's
available at http://www.rabago.net/struts/formdef/dev/nested.war . 
It's using FormDef (which is a Struts plugin) but FormDef doesn't
affect validation, so the same rules apply.  Using nested tags also
don't affect validation.  In fact, you could use plain old HTML tags
and still use Validator, as long as you name your fields correctly
and/or populate your form beans properly.

Hubert


On 7/5/05, Kjersti Berg <[EMAIL PROTECTED]> wrote:
> Hi
> 
> I would like to validate some nested, indexed properties on my form.
> I've googled and found someone having similar problems, but haven't
> found a solution yet. Any help would be great.
> 
> The form contains a list of Job objects, each having a set of
> properties, let's say number and size. I tried to define the
> validation like this:
> 
> <field property="number" indexedListProperty="jobs" depends="integer">
>    <arg0 key="absence.label.unitOfAbsence"/>
> </field>
> <field property="size" indexedListProperty="jobs" depends="integer">
>    <arg0 key="absence.label.scale"/>
> </field>
> 
> This does not work, although as far as I can tell, this is how the
> documentation recommends using it.
> 
> However, in the jsp, the values are collected using the nested tag,
> not the logic/bean tags.
> <nested:iterate property="jobs">
>    <nested:text property="number"/>
>    <nested:text property="size"/>
> </nested:iterate>
> 
> Would this interfere with the validation, or are the two tags
> identical when it comes to validation?
> 
> I'm using Struts 1.1.
> 
> Kjersti
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to