I have an Apex dynamic event that has 2 parts:
1) calls PL/SQL (generates Anychart XML) and returns this as the value for hidden textarea
2) calls a Javascript function that displays a JQuery floating window in which an Anychart graph (using the XML in textarea) is rendered
This works fine (and has been implemented via custom regions in the Apex theme used), and is used on a number of my Apex app pages.
However, on one specific page the PL/SQL call used, takes between 5 and 10 second (runs a fairly data intensive query). I would like a visual clue to be generated that "stuff is happening, please wait", at the start of the dynamic call.
I created a visual feedback region that renders when JQuery ajaxStart() is called, and is hidden when ajaxStop() is called. This works for autocomplete page items for example - the please wait displays as the autocomplete runs a db query to pull a list of matches.
However, it does not work with dynamic events.
The ajaxStart() event is triggered immediately upon execution of the dynamic action (as console.log() calls show). But rendering is delayed.
It seems that the calls are made asynchronous synchronous. Before the custom function (called by the ajaxStart() event) renders the please wait region completely, the PL/SQL step in the dynamic action seems to called. So the console.log() shows ajaxStart() was triggered, please wait is not yet rendered, and dynamic action's PL/SQL call is executing and blocking the browser from refreshing the browser window and rendering the please wait region.
When the PL/SQL step in the dynamic action is completed, there is a quick flash in the browser window as the ajaxStart() event's rendering is completed, only to be removed immediately by the ajaxStop() event, then followed by the display of the JQuery floating window widget and Anychart graph in it.
Will appreciate pointers as to what the problem could be, and how it can be addressed.