4 Replies Latest reply on Feb 15, 2007 8:02 AM by pmuir

    Partial Validation

    eiswind

      Has anyone an idea how I can do a partial Validation ? I have a button that submits my page and I want some fiels to be validated at this time but other field need to be validatet later on. I think this is a problem with the update model phase but maybe someone has a similar problem ?

      Thanks for any ideas.

        • 1. Re: Partial Validation
          kukeltje

          validated meaning?
          - required or not?
          - format validation?

          The former can be done by making te required attribute on the input elements conditional e.g. via an el

          • 2. Re: Partial Validation
            kukeltje

            you have to make them not NotNull on the model then. Would be nice if we had the option to specify @NotNull(condition="#{myEl}") on the domain and have hibernate/jpa/ejb3 not generate a notNull in the database. That way we can easily make a difference to 'temporary save the data' or realy finish the form (jBPM has functionality for this)

            • 3. Re: Partial Validation
              agori

               

              "eiswind" wrote:
              Has anyone an idea how I can do a partial Validation ? I have a button that submits my page and I want some fiels to be validated at this time but other field need to be validatet later on. I think this is a problem with the update model phase but maybe someone has a similar problem ?

              Thanks for any ideas.


              MyFaces Sandbox has something about partial data submission.
              Another choice could be the use of ajax (I suggest ajax4jsf).

              Maybe, but not sure about it, could be usefull also the "immediate" property (it is in every UICommand and EditableValueHolder component).

              • 4. Re: Partial Validation
                pmuir

                1) Use ajax (a4j works well with Seam, and the booking example shows partial validation)

                2) Don't use ajax, make sure the fields which aren't validated til later aren't rendered until the first set of fields are valid.