Aliaksei
Aliaksei

Reputation: 1457

CellList and multiple DataProviders

Is it possible to switch CellList between several DataProviders? For example ListDataProvider and AsyncDataProvider?

dataProviderAsync.addDataDisplay(getView().getCellList());
dataProviderList.addDataDisplay(getView().getCellList());

I can add some providers, but I can't clean datadisplay

public Set<HasData<T>> getDataDisplays() {
    return Collections.unmodifiableSet(displays);
}

Upvotes: 0

Views: 54

Answers (1)

Adam
Adam

Reputation: 5599

You can not have many data providers for one data display at one time (you can have many displays for one data provider).

However you can change data provider at run-time.

If you want to switch between data providers (I guess when new data arrives on AsyncDataDrovider) you can override onRangeChanged() of your data provider and change data display.

One important thing is that onRangeChanged() is fired when there is a data display added to the provider. So you have to add some 'dummy' display, wait for data and then change display.

Upvotes: 2

Related Questions