cancel
Showing results for 
Search instead for 
Did you mean: 

How to show loading image while table is filled?

Former Member
0 Kudos

Hi guys,

I have some tables which are bound to OData. The time (a few seconds) after the data are loaded and before the table is filled, the table shows „no data“. This might confuse the user. I’d like to replace the „no data“ by a loading image. And only tables which really don't have any data, should „no data“. Can anyone help me please?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

ChandraMahajan
Active Contributor
0 Kudos

Hi,

you can use LocalBusyIndicator. Refer SAPUI5 SDK - Demo Kit

Regards,

Chandra

Former Member
0 Kudos

Hi Chandra,

can you give me an example, please? The one on demo kit - control is useless for me because the busy indicator is only shown after pressing the button.

Regards

Former Member

I got it. Using following code:

oModel.attachRequestSent(function(){
sap.ui.core.BusyIndicator.show(0);
});

 

oModel.attachRequestCompleted(function(){
sap.ui.core.BusyIndicator.hide();
});
former_member185414
Active Contributor
0 Kudos

Thanks Fata, it helped me too.

Answers (1)

Answers (1)

former_member184867
Active Contributor
0 Kudos

You can use the following snippet


var oTable = new sap.ui.table.Table("oDataTable");

    var oImage = new sap.ui.commons.Image();

    oImage.setSrc("http://www.sap.com/global/images/SAPLogo.gif");

  oTable.setNoData(oImage);

Regards,

Atanu

Former Member
0 Kudos

Hi Atanu,

thanks for your reply. The problem of using oTable.setNoData(oImage) is that also those tables which don't have any data will show the image.

Cheers

former_member184867
Active Contributor
0 Kudos

I think the effect will be visible only with the current table referred by oTable. Did you try the code ?

Former Member
0 Kudos

Hi Atanuk,

I tried your code, but it doesn't work as I wished

Cheers