-
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
Expose validate() method to allow developers to trigger validation manually #6634
Comments
Using the |
We could proceed with this one, but would be preferable to have a clear documentation on how it affects the validation through Binder. |
This would also enable us to add docs examples for required validation for RadioGroup and Select, similar to the Checkbox article after Binder usage is replaced with the |
Describe your motivation
Field components lack an API to trigger their constraint validation manually. Manual triggering would be useful for example when you are building a simple form where you don't want to use Binder because constraint validation is sufficient, but you do want to validate the fields on a certain action like submit button click.
Having this API would also allow us to rewrite some docs examples to not use Binder, for example: https://vaadin.com/docs/latest/components/checkbox#required
Describe the solution you'd like
All field components already have a
validate
method that could be used for that purpose. It just needs to be made public.Describe alternatives you've considered
The only available alternative at the moment is to use Binder because it provides a
validate()
method.Additional context
The text was updated successfully, but these errors were encountered: