Announcement Announcement Module
Collapse

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions (http://www.springsource.org/extensions) project, this forum has been decommissioned in favour of Spring Extensions one at:
http://forum.springsource.org/forumdisplay.php?f=44

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Cheers,
Costin Leau
SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
http://twitter.com/costinl
See more
See less
ValidWhen Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ValidWhen Error

    Hi,

    I have the following ValidWhen validator set up for my form and it throws an error b/c
    ValidWhen cannot resolve the "test" variable. Does anyone see something wrong with this xml?

    Code:
                <field property="miles" depends="integer,validwhen">
                    <arg0 key="miles"/>
                    <var>
                      <var-name>test</var-name>
                      <var-value>(miles!= null)</var-value>
                    </var>
                </field>
    I looked at the relevant validateValidWhen method that throws this error and it looks ok to me (so I'm not sure the bug is spring-modules instead of my above config):
    Code:
            ......
             String test = field.getVarValue("test");
            if (test == null) {
                String msg = "ValidWhen Error 'test' parameter is missing for field ' " + field.getKey() + "'";
                errors.rejectValue(field.getKey(), msg);
                log.error(msg);
                return false;
            ......
    I am seeing a message in my logs that says:

    ValidWhen Error 'test' parameter is missing for field ' miles'";
    Any help is appreciated.
Working...
X