Hi all,
here’s my problem.
How is possible using a BeanItem in a form and manage 1: many relationship?
E.g.: The target is create a form with a TextField (Person name) and a combobox with addresses List, choose one and save
class Person
Integer id
String name
Set addreses = new Hashset();
//
class Address
Integer id
String name
String zipcode
//
Person person = new Person();
BeanItem persItem = new BeanItem(person);
persItem.addItemProperty(“ads”, new MethodProperty(person , “addresses”))
Form persForm = new Form();
// FieldFactory
persForm.setFieldFactory(new PersonFieldFactory());
persForm.setVisibleItemProperties(Array.asList(new String {…})
Choosing a combo box item the result is:
com.vaadin.data.Property$ConversionException: java.lang.NoSuchMethodException: java.util.Set.(java.lang.String)
There are other way to proceed to avoid this problem?
Thanks