Hi,

I'm trying to use the "requiredif" validation on fields in a nested
collection and am not having any luck.

Here's the excerpt from the validation.xml
...
        <form name="/submitFamily_2004">
          <field
              property="campus" indexedListProperty="alumni"
depends="requiredif">
            <arg0 key="prompt.family.campus"/>
            <var>
              <var-name>field[0]</var-name>
              <var-value>firstname</var-value>
            </var>
            <var>
              <var-name>fieldTest[0]</var-name>
              <var-value>NOTNULL</var-value>
            </var>
          </field>
        </form>
...

The jsp shows a collection (say, 2) of "alumni" beans.  Each alumnus has a
textbox for entering a first name and a textbox for entering a campus.  I
want the campus to be required IF the user enters a value for the first
name.  But, nothing happens.

If I change the validation.xml so that field[0] points to a variable outside
of the nested collection then everything works fine and messages appear
saything that the firstname in the collection is required.

Is there a way to modify the xml so this will work or is the requiredif-type
validation not (yet?) implemented to work with nested collections?

Thanks for the help!
-Tamara

Reply via email to