struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Arnason, Tamara" <Arnas...@sysadm.suny.edu>
Subject RequiredIf Validation with nested
Date Tue, 22 Jul 2003 13:24:47 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message