Class AbstractForm<T>

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
org.vaadin.firitin.form.AbstractForm<T>
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasStyle, Serializable

public abstract class AbstractForm<T> extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
A basic form class to avoid a ton of boilerplate code. Provided things like data binding, save and cancel buttons and controls their state based on the input in the form and deals with some of the quirks of Binder.

For binding this form uses naming conventions, so for each field of your edited entity, it searches similarly named Vaadin component from your class extending AbstractForm.

By default, BeanValidationBinder is used, so validators defined in your DTO or entity class are taken into account. Note that Vaadin don't currently support class level validators so that must be handled separately. Binding is always non-buffered variant, create a clone of your DTO if you mind that it might get changed even if user don't press the save button.

Author:
mstahv
See Also: