2 Replies Latest reply on Aug 1, 2011 12:07 PM by apostle

    validation

    apostle

      Hello Dear Community,

       

      I use hibernate validation framework to validate users' input on a JSF page. I'm wondering if it is possible to bypass validation on a page? I want to make possible storing half way results in the DB. Is there any way to do it?

       

      Any ideas would be gratefully appreciated.

        • 1. Re: validation
          iabughosh

          you can use validationGroups to solve this :

           

          @NotEmpty(message="{MSG}", groups={gourps.EditGroup.class})

          yourBeanProperty

           

          xhtml :

          <f:validateBean validationGroups="gourps.EditGroup">

          <h:inputText id="" value="#{bean.yourBeanProperty}"/>

          </f:validateBean>

           

          where EditGroup is an Empty Inteface

           

          regards.

          • 2. Re: validation
            apostle

            Hi Ibrahim,

            thank you for your response, but I'm not sure I got the idea. Could you please explain it in more details. Lets assume a page has few inputs and two buttons. When a user pushes the first button, data is going to be stored without validation and if user pushes the second button, data is validated and stored. How the page would look like in this case? Thanks