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:
- var oModelData;
- var oDataModelSearch = new sap.ui.model.odata.ODataModel("..<service name>..",false);
- sap.ui.getCore().setModel(oDataModelSearch, "OModelSearch");
- sap.ui.getCore().getModel("OModelSearch").attachRequestSent(function(){
- sap.ui.core.BusyIndicator.show(10);
- });
- oDataModelSearch.read("/Entity",null,null,false,
- function fnSuccess(oData){
- this.data= oData.results;
- oModelData= oData.results;
- },
- function fnError(response){ });
- sap.ui.getCore().getModel("OModelSearch").attachRequestCompleted(function(){
- sap.ui.core.BusyIndicator.hide();
- });
- 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