Semi-lazy ComboBox

Hello

In my usecase I need the combobox to only load values when the user clicks on it, which LazyDataView achieves, but to then check if the values need to be updated if the ComboBox is opened again. However, LazyDataView seems to only fetch again when it has been refreshed and the focus listener is unreliable on touch devices.

Is there a type of provider or a construct that achieves this behaviour?

You could add an event listener for the vaadin-combo-box-dropdown-opened event and refresh the combobox at that point in later events.

something like

comboBox.getElement().addEventListener("vaadin-combo-box-dropdown-opened", event -> /* do your data update / refresh */);
2 Likes

Hello Stefan

That seems to do the trick. Thank you very much for your help.

1 Like