I want to bind a multiselect OptionGroup to my Entity which holds an List.
I did it like this:
OptionGroup kategorieInput = new OptionGroup("Kategorien");
kategorieInput.setContainerDataSource(new BeanItemContainer<>(Kategorie.class, kategorieDataSource.holeAlleKategorien()));
kategorieInput.setMultiSelect(true);
itemBinder.bind(kategorieInput, "kategorien");
where “kategorien” is a java.util.List in my Entity…
But everytime I try to commit i get the following Exception:
Caused by: com.vaadin.data.util.converter.Converter$ConversionException: Unable to convert value of type java.util.LinkedHashSet to model type interface java.util.List. No converter is set and the types are not compatible.
Is there a way to implement a converter for this problem?
I tried to implement the Interface Converter<PRESENTATION, MODEL>, but I can’t assign it to my Optiongroup…
Hope someone knows a workaround!
Thanks in advance!