Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

TUTORIALVaadin lets you build secure, UX-first PWAs entirely in Java.
Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
Calling javascript synchronously by Enver Haase, 3 weeks ago
BeanItem and collections
Hi,
This is how data binding for my simple form works:
class Person{
String firstName;
String lastName
Address address;
}
class Address{
String street;
String zipCode;
String city;
}
item = new BeanItem<Person>(person);
item.addNestedProperty("address.city");
fieldGroup = new FieldGroup();
fieldGroup.bind(city, "address.city");
fieldGroup.setItemDataSource(item);
fieldGroup.bindMemberFields(this);
Instead of Address address; I now have List<Address> addresses;
I am creating the form fields dynamically with buttons to "add new address" and "delete this address".
What would be the best way to handle the binding?
Thanks,
Roland
Last updated on
Mattiās https://github.com/viritin/viritin/blob/master/src/test/java/org/vaadin/viritin/it/EditPerson.java might give you sime pointers.
HTH
Niki
Last updated on
You cannot reply to this thread.