Skip to Content
2
Former Member
Jun 09, 2015 at 05:42 AM

Busy Indicator is not working with OData Model

1095 Views

Hi All,

I am trying to make OData read call to get the data and I want to display a busy indicator until I get the data from backend.

To do this , I have used attachRequestSent and completed method and inside those I have used .show() and .hide() method. But these methods and never getting executed,

This is the order I have used:

  1. var oModelData;
  2. var oDataModelSearch = new sap.ui.model.odata.ODataModel("..<service name>..",false);
  3. sap.ui.getCore().setModel(oDataModelSearch, "OModelSearch");
  4. sap.ui.getCore().getModel("OModelSearch").attachRequestSent(function(){
  5. sap.ui.core.BusyIndicator.show(10);
  6. });
  7. oDataModelSearch.read("/Entity",null,null,false,
  8. function fnSuccess(oData){
  9. this.data= oData.results;
  10. oModelData= oData.results;
  11. },
  12. function fnError(response){ });
  13. sap.ui.getCore().getModel("OModelSearch").attachRequestCompleted(function(){
  14. sap.ui.core.BusyIndicator.hide();
  15. });
  16. return oModelData;

Is there somthing I am missing, or the order should be something else.

PS: When I run this in debug mode, after going to line 4 its directly jumping to Line 7 skipping line 5.

Thanks in Advance!

Regards,

Anupriya