Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    skip validation for a field

    Hello, as the doc says, the method dsRequest.setValidated can be used to skip validation server side.
    I've tried it in a dataSource with a serverConstructor, overriding the execute method, and it works: I've conditioned it for a particular user role.
    Is it possible to skip validation only for a specific field, instead?
    I've looked for something like dsRequest.getField("foo").setValidated but found nothing.

    #2
    The way to do this would be a custom validator that looks in the ValidationContext for a flag you've set on the DSRequest or one of the other context objects.

    Comment


      #3
      Thanks for the hint. Actually I was looking for a centralized way of doing it, I managed to do it in the override of the execute method, by checking the ErrorReport object and modifying it before returning the DSResponse.
      Is it safe to do this?

      Comment


        #4
        Yes, modifying or replacing the errors is perfectly valid.

        Comment

        Working...
        X