DateField Validation

Hello,
I create a DateField within a Vaadin form. I add custom validator to the date field to ensure the date is before now. The custom validator simply extends the AbstractValidator and implements the boolean isValid method.

On runtime, when invalid date has been selected by the popup I got exception in the log:

com.vaadin.data.Validator$InvalidValueException: select correct date
at com.vaadin.data.validator.AbstractValidator.validate(AbstractValidator.java:64)
at com.vaadin.ui.AbstractField.setValue(AbstractField.java:493)
at com.vaadin.ui.DateField.setValue(DateField.java:509)
at com.vaadin.ui.DateField.changeVariables(DateField.java:416)

and the error message is shown twice in the popup.

Is this a bug, or I’m misusing the API somehow? Seems like the DateField.setValue overrides the AbstractField.setValue and skips something.

Thanks in advance and regards,
Dinko

P.S. I managed to workaround it by overriding the DateField.setValue(Object, boolean) method and swallowing the InvalidValueException.

Hi,
I have experienced the same problem under nearly the same circumstances (custom validator on DateField) and would appreciate any advice whether this is a bug or just wrong usage of DateFields / Validators.

@Dinko: Thanks for your workaround. It works well for me, too.

Regards,
Oliver