ComboBox and Lazy Loading

Hi,

is it possibile to deactivate lazy-loading of combobox-values, when the user opens the drop-down-box?

I want absolutely no delay when opening the drop-down. The values come from a static list, so i can pass them directly when rendering the UI-Element.

Unfortunately I can not use NetiveSelect, because the values are wider than the UI-Element and IE truncates those :frowning:

Many thanks in advance, Andreas

Hi!

Yes, you can, with cBox.setPageLength(0)
However, if you add many items, they may float outside of the screen. If you add overflow: scrollable to the css, defining some pixel height and remove the shadow I guess it would work.

Hello Johan,

thank you for your reply.

setPageLength(0) forces the combobox to show all values on one page.

But it does not deactivte lazy-loading: When i click into the combobox and the drop-down opens, still a JSON-request is performed which loads the entries from the server.

Best Regards, Andreas

Hi,

Well, in a way it disables the lazy loading, by not having to do more requests when scrolling the items. It is true that a new request is made for every time the ComboBox’ dropdown is shown. It is also strange that even if the field is non-immediate and filtering mode OFF, requests are still made for any character you are typing. If responsiveness is of great importance, I would NOT use ComboBox. Have you checked
the Directory
? Maybe someone has made a component for this purpose.

Hi Johan,

thank you again for your reply. In the meantime i have switched to Smart-GWT’s combobox. This one works fine for us. I currently verify whether i am allowed to publish the Vaadin-Binding for the Smart-GWT-Combobox.

Best Regards, Andreas

Hi,

Nice that you got it working. I think there are many developers out there looking for a more responsive ComboBox, so I think it would be good add-on for the Directory. That way you could also get it tested by others and have possible issues reported :slight_smile:

BR,
Johan