• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Regarding validation_rules.xml file

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

We all know that validation_rules.xml file contains all the validation functions like date,credit card,email etc.

My question is , Can we add our own functions to that file ?

If so, what is the procedure ?

thanks in advance,

Johnson
 
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you can very well do that.
Just define your own validating class and declare it in validator-rules.xml

you have to mention in the validator tag like this


<validator name="myvalidationrule"
classname="org.test.example.MyValidatorRule"
method="validateSomeRule"
methodParams="list of parameters"
depends=""
msg="errors.myvalidationrule"/>

in validation.xml say
<field property="blahblahblah" depends="myvalidationrule"></field>
 
reply
    Bookmark Topic Watch Topic
  • New Topic