Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Busy Indicator does not appear before AJAX call executes

$
0
0

Hello,

 

I’m trying to display a BusyIndicator on my screen after a button click event, and hide it when execution of the corresponding call returns.  If I put a breakpoint in my code before the AJAX call fires, the busy indicator appears, but if I do not have a breakpoint and click the button, the busy screen never pops up, even though execution of the call takes 20-25 seconds.  What can I change to make sure the busy indicator comes up every time?

 

 

executeCall = function (oData, viewPrefix) {        var message = [];        var success = false;             sap.ui.core.BusyIndicator.show(0);        $.ajax({            type: 'POST',            url: pps.config.pmvSvcUri,            data: JSON.stringify(oData),            contentType: 'application/json',            async: false        }).done(function (results) {            if (results.errors.length > 0) {                utilities.displayError(results.errors[0]);            }            else if (results.messages.length > 0) {                 results.messages.forEach(function (msg) {                      message.push(                      + "EVENT_DATE: " + msg.EVENT_DATE + "; \n"                      + "USERID: " + msg.USERID + "; \n"                      + "FUNCTION_NAME: " + msg.FUNCTION_NAME + ";\n"                      + "ERROR_MSG: " + msg.ERROR_MSG + "; \n"                      + "ERROR_CODE: " + msg.ERROR_CODE + "; \n"                      + " - " + msg.ERROR_DTL                      + "\n");                });               utilities.displayError(message[0], results.messages[0].ERROR_MSG);                sap.ui.core.BusyIndicator.hide();            }       else {       success = true;       if (results.insertedPmtId){            oData[0].ID = results.insertedPmtId;       }       sap.ui.core.BusyIndicator.hide();       }        }).fail(function (results) {            if (results.error.length > 0) {                 utilities.displayError("Error: " + results.error, 'Error');            }            else {                 utilities.displayError("Error: " + results.status + ' ' + results.statusText, 'Error');            }            sap.ui.core.BusyIndicator.hide();        });        return success;    },

Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>