Vaadin-combo-box: Support for data provider / lazy loading

Created on 17 May 2018  ·  14Comments  ·  Source: vaadin/vaadin-combo-box

The component page on the Vaadin website mentions support for lazy-loading (and remote filtering) as the first vaadin-combo-box feature:

screen shot 2018-05-17 at 17 11 42

But more than a proper feature, it's just exposing a filter to let another something to replace the items. A proper data provider with pagination support for infinite scrolling (like in vaadin-grid) would be preferable.

Notes

epic

Most helpful comment

This is kind of a feature that old Vaadin users assume to be there. I can't consider Vaadin 10 to be ready before our combo-box can handle a large number of options without choking the browser or the network. Please get this done!

All 14 comments

Any feedback on this? Maybe not an high priority for the web component itself, but from the perspective of Java developers trying to port apps from FW8 to Flow this is a quite a blocker when behind a ComboBox there is a huge pool of items and the use of a lazy data provider is mandatory.

True, combo-box doesn't really have a proper lazy-loading API at the moment. This is a good candidate for an enhancement. Should be aligned with the dataProvider API of the grid.

This is kind of a feature that old Vaadin users assume to be there. I can't consider Vaadin 10 to be ready before our combo-box can handle a large number of options without choking the browser or the network. Please get this done!

Hi,
I totally agree with @mstahv . After 3 productions apps with V8, I started a new project 2 months ago and took V10. Dealing with large data sets was one of the main features we took Vaadin and also paid for subscription. Frankly I didn't even consider this features is missing. Now we have TextField with Grid below to simulate autosuggestion. It really looks strange.

Both this and #88 are evidently the most requested features, but I perceive from various discussions with the team the will to revamp the component code before introducing new features. There are indeed some obscure lines which may scare fellow contributors 😃

Can the team shed some light on the upcoming evolution of this component? Will new features be added to the current code base or there's a revamp taking place before that?

@tomivirkki, do you have a good answer for @heruan? I’m also interested to hear the team’s thoughts about the maintenance of this component, whether it would need a refactor/rewrite before adding more complex features?

Though the API probably won’t see much changes, so from that point of view, if it is reasonable, we could first ship these much-requested features and then start working on the rewrite.

We're doing some research on how painless it would be to add this feature on top of the current source code. In best case scenario, it wouldn't require bigger changes to the existing source but most of it could be included as a mixin (like in vaadin-grid's case).

@heruan and @mstahv just to make sure, are you aware of the filteredItems API of <vaadin-combo-box>? It can be used to show any custom options in the combo-box dropdown while bypassing the built-in filtering. Kind of similarly as with Google's search field; you type something into it and get a list of relevant suggestions below the field. In case of <vaadin-combo-box> you can obviously have much more options (the filteredItems array).

Is there some relevant use-case which requires a dedicated lazy data provider API and which can't be covered with filteredItems API?

I'm here only as the Flow team told they need it first for the web component ;-) I guess selecting a person from a large set is a good example. So large set that it don't make sense to send them all to the browser at once.

@tomivirkki, I think the use case Matti describes would be difficult to implement. You would need to maintain the selected item’s ID/index somewhere and then, when the user clicks the combo box open, fetch the correct page of items (which contains the selected item), while still making sure the combo box dropdown shows the scroll position correctly.

Just to make it clear: combo box is different than autocomplete.

@tomivirkki I'm aware of the filtering capabilities, which can restrict the loaded number of items, but we are facing cases where the filter returns many items so the data transfer is still an issue. Scrolling the dropdown should paginate the items like it is in <iron-list> I'd say.

In my experience, I've noticed some users expect to be able to scroll a combo box to find the desired item without typing anything.

Hi,
Is it possible to test and use this feature with V11 Java? Or when can we expected to bi in V11 Java? Thank you.

@maticpetek the progress on Java version can be tracked at vaadin/vaadin-combo-box-flow#131

We hope to manage to release 4.2.0 stable version to in few weeks so that it could be included in V12, which will enter a beta stage in the early November.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

osamamaruf picture osamamaruf  ·  4Comments

web-padawan picture web-padawan  ·  3Comments

GoceRibeski picture GoceRibeski  ·  19Comments

davidmaxwaterman picture davidmaxwaterman  ·  6Comments

silentHoo picture silentHoo  ·  3Comments