In Vaadin 8, the BinderBuilder::asRequired
lets us define a Binder
where a field is known to be required on a layout. If data is missing, the layout indicates to the user that the field needs to have data entered. This is great functionality, and smartly designed.
But using a Binder
can be overkill for very small forms or dialog boxes. For one thing, we must define a data class to interact with the binder which can seem silly for a little form.
➙ Is there any other way to tap into Vaadin’s automatic handling of a required field without using a Binder
?
In the Community Articles section of the manual, there is a page, Mark required fields as such. That page shows TextField
as having setRequired
and setRequiredError
methods. But this seems incorrect. I can find no such methods on the latest TextField
JavaDoc.