2 Replies Latest reply on Mar 20, 2008 6:54 PM by tom_goring

    Custom Validation

      Excuse the newbie question...My company builds online apps that allow people to apply for credit cards online.  We have a lot of custom validation rules such as - If the user's income is greater than 50,000 then make them enter a value in Field X or If they live in a Florida, then they must fill out section 7. 


      Is there a preferred approach to writing custom validation rules with Seam?  I thought I saw someone mention writing a custom annotation that would execute another class that had the rules in it.  Just wondering if there is a preferred approach.


      Thanks

        • 1. Re: Custom Validation
          pmuir

          Currently the recommended approach to doing dependant validation is to do it in your action method. There is no easy way to do this using Hibernate Validator and <s:validate>

          • 2. Re: Custom Validation
            tom_goring

            Hi,


            Is the any simple way of having page level validation within a pageflow?


            E.g.


            <start-page name="Start" view-id="/start.xhtml">
                 <redirect/>
                       <transition name="next" to="part2">
            </start-page>
            



            I.e. on pressing next all my field level validators are called OK but I'd like one for the page to be called before allowing the next page.


            Thanks


            Tom