2 Replies Latest reply on Jan 22, 2008 8:55 AM by pmuir

    Bypass validations in some instances

    bludginozzie

      I want to bypass validations but still write to the data model but I cannot figure out how to do this. I can use immediate="true" however this prevents the valid values from being placed in to the data model.

      Why would I want to do this you ask... Well I have a wizard and when the users clicks next page I want all the validations to fire as normal. However if the users clicks previous page button I want the state of the page saved (i.e. valid values written to the model and invalid values ignored) however no validations to fire. This is standard wizard behaviour.

      Does anyone know how to do this?

        • 1. Re: Bypass validations in some instances
          nickarls

          From the department of long shots:

          Hmmm, you could perhaps skip the s:validate tags and use programmatic validation?

          Or perhaps have a skipValidate boolean in your entity that you toggle and then use custom validators to trigger only when they are true?

          • 2. Re: Bypass validations in some instances
            pmuir

            So, you want to skip the validations when you write to the model? Or when you persist the model to the database? If the former, then you can't use s:validate tags (I worked around this once by calling the validation manually on clicking the next button) - you need to be careful to attach the correct error message to the correct field though...