5. FieldGroup
Remember the old Form?
It coupled display & field handling
It is deprecated
Use FieldGroup
And set the layout you want!
6. Data binding levels
1. Property
Single value
Birthdate
2. Item
Connected properties
First name, last name, birthdate
3. Container
Collection of items
7. Example
Person person = new Person(1L);
person.setFirstName("John");
person.setLastName("Doe");
person.setBirthdate(new Date(0));
BeanItem<Person> item = new BeanItem<Person>(person);
8. Naive implementation
TextField id = new TextField (item.getItemProperty("id"));
TextField firstName = new TextField(item.getItemProperty("firstName"));
TextField lastName = new TextField(item.getItemProperty("lastName"));
DateField birthdate = new DateField(item.getItemProperty("birthdate"));
Layout layout = new FormLayout(id, firstName, lastName, birthdate);