cancel
Showing results for 
Search instead for 
Did you mean: 

Busy Indicator and Dialog is not working in synchronous POST AJAX call.

madhav15
Explorer
0 Kudos

Greeting Experts,

I am trying to execute Busy Indicator/Dialog in synchronous POST ajax call in UI5 like this.

and Ajax call:

I am using Node as a backend API. I have tried as several ways but Busy Indicator is not opening and Busy Dialog is opening but after execution of POST call. Kindly help me to address the issue.

Thanks and Regards,

Madhav

Accepted Solutions (0)

Answers (1)

Answers (1)

boghyon
Product and Topic Expert
Product and Topic Expert
0 Kudos

In browsers, the UI thread is the main thread. While the main thread is busy awaiting a response from the server synchronously, it cannot update the UI at the same time and keeps the UI therefore frozen during the round trip. That is also why the busy indicator cannot be reliably shown during that time. You need to remove the `async: false` and generally never rely on sync XHRs in application development with SAPUI5.

Sync XHR is in the process of being removed by the web as per https://xhr.spec.whatwg.org/#the-open()-method:

> "Synchronous XMLHttpRequest outside of workers is in the process of being removed from the web platform as it has detrimental effects to the end user’s experience. [...] Developers must not pass false for the async argument when the current global object is a Window object. [...]"