-
Notifications
You must be signed in to change notification settings - Fork 728
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
BindingBuilder.asRequired() returns true for nulls #11401
Comments
vaadin-app.zip |
Default implementation of asRequired() is a short hand for the following
The method with custom asRequired validator is also public, see Which gives a workaround
|
Thank you for posting the workaround. Yet I believe that nulls effectively mean "no value" and thus the standard asRequired() method should catch them in addition with the empty value, exactly as your workaround suggests. |
Hello there! We are sorry that this issue hasn't progressed lately. We are prioritizing issues by severity and the number of customers we expect are experiencing this and haven't gotten around to fix this issue yet. There are a couple of things you could help to get things rolling on this issue (this is an automated message, so expect that some of these are already in use):
Thanks again for your contributions! Even though we haven't been able to get this issue fixed, we hope you to report your findings and enhancement ideas in the future too! |
I think there's an even easier workaround, but I'm too lazy to test it in practice. The null representation converter and the required validator are forming a processing chain where order matters. If you change the order between validator and the converter, then the validator will see the original value from the field (i.e.
|
setting asRequired before withNullRepresentation actually solves it for me 👍 |
Vaadin 8.6.3. I have the following binder setup:
The problem is that with this setup, an empty
TextField
passes theasRequired()
validation and null is passed intoPerson.setName()
with the following code:The text was updated successfully, but these errors were encountered: