zbyszek26104
zbyszek26104

Reputation: 437

Waiting for data for CellTable in GWT

I'm using GWT 2.4 with RequestFactory mechanism. With bigger portions of data there is some extra time (1-2 sec) for celltables to get populated. During that time celltable is empty and user doesn't know if anything will appear in it. Is there any way to enable waiting indicator for celltables for the time they are being populated?

I've already configured waiting indicator for RequestFactory calls, so I've got prepared images for it, but I don't know how to do it.

Thanks.

Upvotes: 2

Views: 3003

Answers (2)

Adarsha
Adarsha

Reputation: 895

You can use setLoadingIndicator API of CellTable -

cellTable.setLoadingIndicator( Your customised loading indicator widget );

Widget can be a image wrapped with in a panel or just an image.

If you are using the ListDataProvider you need to code some more lines. When you do addDataDisplay method call it internally updates the row count to 0. With this Tables's state gets changed to Loaded. So we don't get the loading image.

Workaround is, do addDataDisplay method call only just before the dataProvider.setList call.

Upvotes: 4

Suresh Atta
Suresh Atta

Reputation: 121998

Before you are calling the setLoadingIndicator you have to call the below method

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

Upvotes: 1

Related Questions