Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validwhen not work, even validate double not work

 
wayne xu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I have problem in the struts validator.
My form extends the validator.validateForm,
I set the mapping in struts-config.xml
I use struts1.2.4, it contains the antlrjar, and set the path in WEB-INF/lib. I checked the validator-rules.xml has validwhen definition, and the sturts.validator package has the validWhen.class.

I compiled and deployed. I load the page and see the follow formValidationResult from the page source view. Only Reqired, Integer, MaxLength, IntRange are there. The validwhen doesn't there, so not work, even the validate double doesn't work.

Why some worksd, some doesn't? I did something wrong?
Your help would be greatly appreciated.

Wayne
--

---------------
var formValidationResult;
formValidationResult = validateRequired(form) && validateInteger(form) && validateMaxLength(form) && validateIntRange(form);
return (formValidationResult == 1);
}

------------
Here is in the validation.xml:

<field property="matchedPrMW"
depends="double">
<arg0 key="prompt.matchedPrMW"/>
</field>
<field property="gi"
depends="validwhen">
<arg0 key="prompt.gi"/>
<var>
<var-name>test</var-name>
<var-value>((matchedPrName == null) or (*this* != null))</var-value>
</var>
</field>
 
wayne xu
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
asuume the property names are correct, and I have an entry for matchedPrName in the validation.xml

wayne
--
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic