flow-components icon indicating copy to clipboard operation
flow-components copied to clipboard

Introduce way to pre-load ComboBox items on client-side

Open TatuLund opened this issue 2 years ago • 3 comments

Describe your motivation

When ComboBox opens the popup it will fetch a page of items. This lazy loading feature works well when you have ComboBox of large amount of items which you do not want to preload to client. But in some cases the ComboBox item list is not very big, and if there are number of such CombBox boxes in a form and one needs to be able to operate them very quickly, the lazy loading is detrimental for UX. In such applications it would be better to have a variant of ComboBox that has preloaded items and does not perform lazy loading at all, I call this ComboBoxLight, but naming can be still debated.

Describe the solution you'd like

In earler Vaadin 14 versions it was possible to implement this by extending GeneratedVaadinComboBox. This version in my Gist collection can be used as reference:

https://gist.github.com/TatuLund/0c4e8ce34a62220e2ba2c654ffdd855f

Describe alternatives you've considered

As an alternative there could be alternative load mode in existing ComboBox, but based on my experience with the linked component, the best approach is to drop DataCommunicator as it is not needed and do other simplifications. This would be hard to make in reliable fashion in existing ComboBox, thus I think having simplified component variant is more robust and avoids breaking changes in existing ComboBox and has more straightforward testing strategy.

Additional context

No response

TatuLund avatar Mar 15 '23 06:03 TatuLund

Even with lazy loading ComboBoxes, you'd probably want to have the first page pre-loaded when this mode is enabled.

tomivirkki avatar Mar 28 '23 11:03 tomivirkki

There is now component in Directory for this https://vaadin.com/directory/component/light-combobox

TatuLund avatar Jun 22 '23 07:06 TatuLund

See also: https://vaadin.com/forum/t/combobox-still-poor-quality-and-not-suitable-for-data-entry-application/168345/3

TatuLund avatar Feb 20 '25 06:02 TatuLund