File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

validwhen - struts validation

 
Gayatri Ganesh
Ranch Hand
Posts: 143
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I need to validate a field called age only when a boolean isAge is true, ie age is a required field only when boolean isAge is true.
And also age should be an integer only. I

In my validation.xml I have :

<form name="/a/b/c">
<field property="age" depends="validwhen,required,integer">
<arg0 key="errors.invalid"/>
<var>
<var-name>test</var-name>
<var-value>((isAge == 'true') and (*this* == null))</var-value>
</var>
<msg key="error.age.integer" name="integer"/>
</field>
</form>

But I always get the error message, even if I enetered a valid age.
Can anyone please tell me what is wrong ?

Thanks,
Gayatri
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic