Skip to Content
0
Former Member
Jul 21, 2017 at 09:18 PM

Busy Indicator in recursive Odata Call not working

77 Views Last edit Jul 21, 2017 at 09:22 PM 2 rev

Hi All,

I have an requirement where in i have to call the gateway service multiple times from the UI. I had to show the Busy Indicator when i am fetching data and have to hide the Busy Indicator once all the service calls which called in recursively. In the Busy Indicator i have to show the Progressive Indicator showing how many percentage completed during each service call has to be updated.

The problem which i am facing now is when i am calling the Busy Indicator - sap.m.BusyIndicator first time i am getting the Progressive Indicator (some text with Percentage and no's) is coming up and the incremental update is not working when each service is called. Once all the service call is done the Busy Indicator is updated with the final results with Progressive Indicator. The Busy Indicator some how is not updating the model which i am doing it in after the service call is done. When i am debugging the Busy Indicator is working fine with the Incremental Progressive indicator after each service call. Please find below the code snippet

this.showBusyIndicator();

if (employeedata.length > 0) {

if (empdata.length > Number(Threshold)) {

var initialEmployeeData = employeedata.splice(0, maxThreshold);

jQuery.sap.delayedCall(0, this, function() {

var newCompData = 25;

for (var i = pageConfig.CurrPage; i <= pageConfig.NoOfPages; i++)

{

models.modelAction(ref, userdata, initialEmployeeData, [], [], [], "", failureMsg);

}

In the success call back of Model i have the below code for Progress Indicator. I have mocked the data but in real time i will be calling a method for determining the values.

Query.sap.delayedCall(10, this, function() {

var data = viewRef.getView().getModel("Status").getData();

data.EmpCount = data.EmpCount + 25;

ref.getView().getModel("Status").setData(data);

if(data.EmpCount >= data.TotalPageCount){

jQuery.sap.delayedCall(1000, this, function()

{ viewRef.hideBusyIndicator();

});

}

});

Kindly let us know if any one have solution for the Busy Indicator.

Thanks and Regards,

Saravanan