Open egloffmark opened 1 year ago
Known limitation (at the moment) as described in the upgrading guide to 24 for fields with custom frontend validations - like the EmailField. If you wanna have full flexibility, use the TextField instead of the EmailField. Other than that nothing has to be changed and your validation is correctly utilized and the error message is shown.
Ok thank you, seems to be related to the known "bug" #4618
I'm confused, even if it's a known limitation, the example above was taken from Vaadin docs. So at least the documentation needs a mention about this limitation in https://vaadin.com/docs/latest/binding-data/components-binder-validation or show a working code example.
Description of the bug
I tried to follow the documentation tutorial to create a FormComponent with Binder and standard Validation for an email field. See here https://vaadin.com/docs/latest/binding-data/components-binder-validation
But when I configure the binder with EmailValidator it does not show the error message. The passed error message at the time the validation is empty.
My Form Component:
Debugging the issue I see that in
DefaultBinderValidationErrorHandler
the error message is empty, so it looks like that it has not been taken over from the EmailValidator.The problem at the
EmailField
seems to be related to the underlyingTextFieldValidationSupport
and that there no error message can be set and may overload another validatorWorkaround is to add an own status handler or to use instead the
TextField
instead of theEmailField
.Expected behavior
There should be an easy way to show and/or customize the error message in case the email address is invalid or you adding a second validator without specifying a custom handler
Minimal reproducible example
Versions