How change combobox filter type

Today I use

ComboBox myCombo = new Combobox
myCombo.setItemCaptionGenerator(MyItem::getName);
myCombo.setItems(myRepo.findAll());

so the filter are AnyMatch I need to put StatrtWith to when my user type something in combo he only search the itens that start with typed

tks

You can give caption filter for the combo box in overloaded setItems(…) method

public void setItems(ComboBox.CaptionFilter captionFilter, Collection items)

See:


https://vaadin.com/download/release/8.3/8.3.0/docs/api/com/vaadin/ui/ComboBox.html#setItems-com.vaadin.ui.ComboBox.CaptionFilter-java.util.Collection-

Have some sample? tks