Validator.isValid() method called several times

Hello,

I observed that if I add a validator for a field in a form the isValid method is called several times ( three times more exactly) :

  • once in fields paint method (through getErrorMesage)
    -twice in form’s getErrorMessage

Is this behavior known?

For me this causes problems on performance level because the validation is very time consuming.

Do you have any recommendation for this?

Thank you

I think I’ve noticed it. The validation mechanism is rather complex and messy, so I’m not amazed. I think a redesign of forms and validation is planned for Vaadin 7.

You could nevertheless file a ticket about the issue to keep track on it.

I don’t really know what you can do about it. If you can check easily whether the field value has changed since the last call, you could cache the validation result.