Announcement Announcement Module
No announcement yet.
How to remove an error from BindException Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to remove an error from BindException

    Hello there,
    I am having a problem that's driving nuts!!!

    I have a form that gets submited with a few parameters. Some of this parameter I am not interested in some circunstances and in others I do care about them. When I am not interested in them the controller reports a binding error on this particular numeric value which is been binded to an empty string. This is expected. The problem is that this errors is preventing my form from continuing to the next step. I know what the error is and to what parameter it is associated but I have been uncapable to remove this error from the BindException. It seems like once the error is in, there is no way to get rid of it other that creating a new instance.
    Have any one run into a similar situation before?? If so, how did you go about it?

    Thanks in advance.


  • #2
    Can't you not do the validation to begin with when it's not necessary? I don't think any of the built-in validation is mandatory.


    • #3
      I do need to validate the page. That is the problem. Is there any way to deactivate it and still have the validator's validate method call??


      • #4
        You could move the logic to validate that field into the onBindAndValidate method and only perform the validation (manually) only when appropriate.

        Or you could improve your validation logic handle the more complex logic for when to validate that field using validWhen.