Vaadin 8.1 and Combobox

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

There is method
setScrollToSelectedItem(…)
, but also some issues regarding that has been recorededed (see
#9201
), more over that may be related to
#10248
, which under study now.

Hello Tatu ,

Thanks

I also tried this method and get no result,too.
I use Vaadin 8.1.0

is there any trick to get around this?

Patrick