-
Notifications
You must be signed in to change notification settings - Fork 66
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
Investigate the feedback about the new validation behavior [2 days] #4167
Comments
Confirmed that |
I don't have time to test it properly, but an idea to be tested that it works:
Edit: the required state is just an example for a server validation. A more real example is probably a range validation on the server where the user has to be 18-100 years. If the validation of the server isn't called with the nulled value the second time, it didn't know that the user changed something in the UI - even tho the UI shows an error from the client side validation |
Thank you @knoobie for your input. I tested DatePicker + Binder with this snippet today: public static class Bean {
private LocalDate value;
public LocalDate getValue() {
return value;
}
public void setValue(LocalDate value) {
this.value = value;
}
}
public DatePickerView() {
Div value = new Div();
DatePicker datePicker = new DatePicker("DatePicker");
// datePicker.setAutoOpen(false);
Binder<Bean> binder = new Binder<>(Bean.class);
binder.forField(datePicker)
.withValidator(date -> date.equals(LocalDate.of(2022, 1, 1)),
"Unexpected value")
.withValidationStatusHandler(status -> {
value.setText("Binder Value: " + status.getField().getValue());
})
.bind("property");
Bean bean = new Bean();
bean.setValue(LocalDate.of(2022, 1, 1));
binder.setBean(bean);
add(datePicker, value);
} which confirmed that the value is correctly reset to |
Perfect! Thanks for confirmation! |
Closing as vaadin/web-components#5066 was fixed. |
Let's inquire into the feedback we got about the new validation behavior to find out whether there are any issues that need to be fixed before enabling this behavior by default.
Related to vaadin/platform#3066
The text was updated successfully, but these errors were encountered: