-
Notifications
You must be signed in to change notification settings - Fork 15
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
Implement HasValidation in CheckBox #188
Comments
Thanks for the issue. This depends on web component issue: vaadin/vaadin-checkbox#84 There is a pending PR for it (and it has been there for a very long time). One of the reasons we didn't merge it yet is that we don't have any idea on how the |
So, the HasValidation interface bring in the setErrorMessage() method? That sounds a bit problematic, as that would imply that Check Box should be able to show that message somewhere. But the Check Box web component not a similar field by itself as the others, as it doesn’t have a similar kind of field label or error message. I’m not sure if we should “promote” Check Box and Radio Button web components to similar fields as Text Field etc, so that they would have the label, error-message, and helper-text properties, and the But to me, the so-called “correct” solution is abstracting the “field behaviors” (label, required indicator, helper and error messages) out of the existing field components, and allowing any “input components” to be used together with that. Like what we’ve discussed on many occasions before (https://github.com/vaadin/vaadin-core/issues/238). After that, the CheckBox Java component could be a field, and the CheckboxGroup Java component could perhaps use the lower level CheckBoxInput Java component internally, which does not have error messages or helper texts. |
Now when the issues for Flow components are moved to the web component repos, I'm closing this in favor of #84 |
Vaadin 14.0.0.beta3.
Is it possible to have CheckBox implement the HasValidation interface?
The reason is that all of the major fields (TextField, ComboBox, NumberField, DateField, etc.) implement it, so one can execute .setErrorMessage() on those fields if necessary, which you can't do on CheckBox (only on CheckBoxGroup?!).
Thanks,
MZ
The text was updated successfully, but these errors were encountered: