Hi All,How can we set the loading image to be visible till the cell table loads ?
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
I have a problem using loading indicators in DataGrid. What is the right way to set to the DataGrid the state of LOADING or LOADED? I didn't find any resource whatsoever anywehere. The support for this is really poor. By the way, whare am I wrong?
I just inizialize my DataGrid using:
myDataGrid.setLoadingIndicator(new Image(/*my ImageResource object*/);
and the during the flow of the program I use:
myDataGrid.fireEvent(new LoadingStateChangeEvent(LoadingState.LOADING));
when I want to put the DataGrid in the 'LOADING' state, i.e. just before making an RCP call, and then:
myDataGrid.fireEvent(new LoadingStateChangeEvent(LoadingState.LOADED));
just after the grid has been populated with data.
This doesn't work.
Please help.
table.setVisibleRangeAndClear() will ensure that the loading indicator appears until setRowCount(0, true) or setRowData() are called.
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.
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);
}
}