use of com.vaadin.demo.domain.Person in project docs by vaadin.
the class CrudToolbar method createEditor.
private CrudEditor<Person> createEditor() {
TextField firstName = new TextField("First name");
TextField lastName = new TextField("Last name");
FormLayout form = new FormLayout(firstName, lastName);
Binder<Person> binder = new Binder<>(Person.class);
binder.forField(firstName).asRequired().bind(Person::getFirstName, Person::setFirstName);
binder.forField(lastName).asRequired().bind(Person::getLastName, Person::setLastName);
return new BinderCrudEditor<>(binder, form);
}
Aggregations