Hello,
I have a question about ComboBox in Vaadin 8.1.
In Vaadin 7 I have the method setValue to jump to the entry in the CobmoBox. What is the name of the method in Vaadin 8?
My Code is:
List<Person> person= new ArrayList<>();
standort.add(new Person("1", "Peter"));
standort.add(new Person("2", "Simon"));
comPerson = new ComboBox<Person>();
comPerson.setItems(person);
comPerson.setItemCaptionGenerator(Person::getItemCaption);
....
public class Person{
private String item;
private String itemCaption;
public Person(String item, String itemCaption) {
super();
this.item = item;
this.itemCaption = itemCaption;
}
...
gridPerson.asSingleSelect().addValueChangeListener(e -> {
comPerson.setValue(new Person(e.getValue().getPerson(),e.getValue().getPerson()));
});
In my database only the “item” is stored. how can I jump to the entry without the second parameter “itemCaption”?
Thanks
Patrick