6 Replies Latest reply: Dec 5, 2011 6:43 PM by Chris Muir-Oracle RSS

    Field level Validation in ADF


      We have some forms and we want to implement validation on field level. Means, as soon as i enter a value and move to next field, if the value entered is not as per desired regular expression than it should show the error. What i am trying is applying validator attribute on inputText and setting auto submit to true. It is working but some times page suddenly refresh itself and then the validation don't work.

      Also one validation is to match the passwords (new password and confirm password). If i am using above method i am also not able to get the correct value of new password to match eith confirm password.

      Can someone please suggest whats the right way to implement this functionality in ADF.

      I am using jDev and using Placeholder data control.

      Please suggest

        • 1. Re: Field level Validation in ADF
          Abhijit Dutta

          Does this help?


          • 2. Re: Field level Validation in ADF
            Dimitris Stasinopoulos

            Regarding regular expressions validations:



            and ofcourse:


            • 3. Re: Field level Validation in ADF

              Thanks for the links.

              I am able to apply the field level validation but the problem is using autosubmit=true cause a request to server. This is sometimes causing gap after tab out and a page refresh. So i just want to know if it is right to use autosubmit when there are many fields in the form to be validated as the user tab out or is there any other way? Is java script suggested for such cases?
              • 4. Re: Field level Validation in ADF
                Chris Muir-Oracle
                You only want to use autoSubmit if the validation is to occur on the server (ie. autoSubmit to the server), typically where the validation logic is in a JSF managed bean. If the validator components (eg. f:validator) you're using supports validation on the client (ie. via JavaScript in a browser), then autoSubmit shouldn't be necessary.

                • 5. Re: Field level Validation in ADF
                  Hi Chris,

                  Thanks for the reply.

                  I need some guidline on the best way to do our validation. We will be getting our data from WebService data control. No application module data controls at all. We need validation on the fileds on submitting the form. Can you please suggest whats the right way of doing this. Should i go with <af:validateRegExp> like tags or should i write code in manages bean and use the validator attribute to link. Our validation are simple like matching Regular Exp or comparing two fileds. We will need same validations to be used on different modules of proj as well.

                  Thanks for all your help.
                  • 6. Re: Field level Validation in ADF
                    Chris Muir-Oracle
                    If <af:validateRegExp> meets your requirements then sure, use it. The neat thing about the default validators will do both client side and server side validation. As such bypassing the JavaScript validators by sending raw HTTP requests to your server will still result in the required validation being applied via the server side.

                    For cross field validation, that's most easily done at the JSF bean level. It will require a round trip to the server to perform the validation though (rather than just validated at the client level). Is that an issue? There's an alternative solution but if you're not worried about round trips, go with the simple solution.