-
Notifications
You must be signed in to change notification settings - Fork 168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TimePicker does not raise ErrorMessages of validator #20830
Comments
I dug deeper into that! It is an issue on the order of the validators! First case: binder.forField(angefangenUmTimePicker)
.withValidator(
localTime -> localTime.isBefore(LocalTime.of(11, 00)
"Just before 11."
)
.withValidator(localTime -> localTime.getMinute() % 15 == 0,
"15 minutes stps please."
)
.bind("beginn"); Now enter "12:00" as value into the time picker and the correct error message will be shown. Second case with reversed order of the validators: binder.forField(angefangenUmTimePicker)
.withValidator(localTime -> localTime.getMinute() % 15 == 0,
"15 minutes stps please."
)
.withValidator(
localTime -> localTime.isBefore(LocalTime.of(11, 00)
"Just before 11."
)
.bind("beginn"); Now enter "12:00" as value into the time picker, the filed will turn red but NO (!) error message will be shown- This issue just esists in the time picker component. |
Finally found the issue. I's different from described above. Sorry for that. And even if you enter "12:00" teh validation Message of the respective validator wont be shown. Sorry for the confusion. In Vaadin 23 the behaviour was different. The validation message has been shown - even setMax hab been set. |
@vursen do you think this observation could be a consequence of validation behaviour changes that we made in Vaadin 24? |
Starting from version 24.0, constraint validation has been enabled by default and runs before any custom Binder validators. However, defining error messages for constraints like setMin, setMax, etc., was not possible until version 24.5, which introduced a way to configure them using i18n objects. I reviewed the JavaDoc for |
Would'nt it be a solution to give the priority to the custom validators? |
Thanks for bringing this up. I was quite sure we already had a ticket for updating the Binder documentation, but I couldn't find any. I've created one now: vaadin/docs#4067 |
Description of the bug
The validation.defined Eroormessages are not shown below the timepicker-field anymore.
Expected behavior
The errormessages should be shown below the field as expected, as it works in all other fields an in Vaadin 23.5 an previous
This shot is from the Vaadin 23 Version of our app.Minimal reproducible example
...and then enter invalid values using the UI.
Versions
The text was updated successfully, but these errors were encountered: