You need to make sure that the cell-widget thinks the current page
size is non-zero e.g. setRowCount(x) (where x > 0). You're basically
trying to convince this method to enter the LOADING state -
private void updateLoadingState() {
int cacheSize = getVisibleItemCount();
int curPageSize = isRowCountExact() ? getCurrentPageSize() : getPageSize();
if (cacheSize >= curPageSize) {
view.setLoadingState(LoadingState.LOADED);
} else if (cacheSize == 0) {
view.setLoadingState(LoadingState.LOADING);
} else {
view.setLoadingState(LoadingState.PARTIALLY_LOADED);
}
}
The cacheSize is retrieved eventually from the maximum relative index
in the current page (i.e. the first visible item is index 0) that has
had data associated with it plus one (to convert the index to a
count). This is because as data is pushed into each index in the page,
a placeholder data value of null is pushed into any missing indices up
to the current index.
The curPage size is just the size of the current page, either the
specified page size in the last setVisibleRange call, or if the row
count is exact and the last page is being viewed, then row count
modulo page size (i.e. if there aren’t enough items to fill the last
page).
On Tue, May 15, 2012 at 5:11 PM, Jens <[email protected]> wrote:
>> I looked into this a little while ago and as far as I could tell using
>> the ListDataProvider prevents the loading indicator from ever being
>> shown (long explanation which I never got round to writing up, but if
>> there's interest I will do). The ListDataProvider is intended to be
>> used when all of the data is resident in the client, if it isn't then
>> you should use AsyncDataProvider.
>
>
> Even when using an AsyncDataProvider the loading indicator isn't shown when
> calling list.setVisibleRangeAndClearData(list.getVisibleRange(), true) and
> the list data is empty at that time. I think its independent of the
> DataProvider you use. As soon as you have no data in your CellList the
> loading indicator does not work like expected....well or I have missed
> something obvious?!
>
> -- J.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Web Toolkit" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-web-toolkit/-/305iEPbSaGYJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-web-toolkit?hl=en.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.