4 Replies Latest reply on Jul 10, 2009 7:35 PM by Diego Y K

    disable hibernate validation

    willie slepecki Newbie

      each page of my conversation has three buttons, cancel, back, and next.  is there a way to only activate the validation only on the next button and ignore it on the cancel and back buttons?

        • 1. Re: disable hibernate validation
          willie slepecki Newbie

          in my research i found this article, looks promising for what i want to do


          http://www.sleberknight.com/blog/sleberkn/entry/20071023


          the problem im having is the actual method call to make it work.  seems all this was written in spring, and im unsure how to implement it in my seam environment.


          i think a nice feature request would be to include this functionality in seam.  i find it hard to believe im the only one on the planet that wants to have a back button on their application and doing so would require turning off validation for that moment so the user can actually go back a page.

          • 2. Re: disable hibernate validation
            willie slepecki Newbie

            ok, im almost there.  the last thing i have to overcome is the required flag.  on the input box, i set required = true.  i can now get the hibernate to ignore on my back and cancel button, turns out all i had to do for that was to set required=false and it worked the way i wanted it to.  but my problem now is the next button.  what i need my next button to do i guess is to run a javascript method that changes the required flag to true on the appropriate input boxes and then run the reRender function for all my decorations on the page.  i looked at the javascript the ajax system generates to trigger the rerender but it looks like there are several generated ID numbers in the string and if i hard code them they will break as soon as i change the page in the slightest way.  that obviously doesn't work.


            is there a way to dynamically set that required flag AND trigger the rerender from javascript?

            • 3. Re: disable hibernate validation
              Juan Antonio Viñuales Newbie

              try using immediate="true" on your cancel h:commandButton

              • 4. Re: disable hibernate validation
                Diego Y K Newbie

                I was having the same problem and this worked for me! Thanks!