Carl
Carl

Reputation: 2934

How can I nudge a GWT CellList populated with AsyncDataProvider to refresh its content?

I've setup a CellList using an AsyncDataProvider that calls a server with a search string.

When my user enters a new search string I want CellList to refresh.

How can I tell my CellList to refresh? Do I call removeDataDisplay() and then addDataDisplay?

Upvotes: 1

Views: 590

Answers (3)

Suresh Atta
Suresh Atta

Reputation: 121998

You can try.

cellList.setVisibleRangeAndClearData(cellList.getVisibleRange(), true); 

Reload celltable issue

Upvotes: 3

Adarsha
Adarsha

Reputation: 895

You can call cellList.setVisibleRangeAndClearData( range, true) API to trigger the onRangeChange method of the AsyncDataProvider.

Since you are using Cell list, the above mentioned call should happen when the user scrolls to the end of the currently visible list. And the Range should be -

private Range range = new Range( cellList.getVisibleRange().getStart() + cellList.getVisibleRange().getLength(), cellList.getVisibleRange().getLength() );

cellList.setVisibleRangeAndClearData( range, true);

Upvotes: 0

Thomas Broyer
Thomas Broyer

Reputation: 64541

setVisibleRangeAndClearData maybe?

Upvotes: 4

Related Questions