ComboBox FilteringMode STARTS WITH Vaadin 8

Hello!

In Vaadin 7 I could set the FilteringMode STARTS_WITH for ComboBox, so that it only filters items,
that starts with the text in the field.

Is there any way to do this with Vaadin 8?

Thanks for your replies!

Yes, you need to implement interface ComboBox.[CaptionFilter]
(https://vaadin.com/download/release/8.3/8.3.3/docs/api/com/vaadin/ui/ComboBox.CaptionFilter.html) and override test method, e.g. using String.startsWith(…). You can set your caption filter with ComboBox.setItems(…) or ComboBox.setDataProvider methods(…)

Dear Tatu,

Thank you very much! You saved my day :smiley: