Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Display Wait Animation During PL/SQL Dynamic Action

hpd305Mar 24 2018 — edited Oct 1 2018

I'm currently using APEX 5.1. I defined a dynamic action on a button click that executes a PL/SQL stored procedure then submits the page.

The procedure takes approximately 30 seconds to execute. I'd like to display a wait "spinner" animation while the procedure runs.

I added a JavaScript action before the PL/SQL code with the following statement

     apex.widget.waitPopup();

However the animation appears briefly after the procedure has finished just before the page submit.

How can I get the spinner to appear immediately when the button is clicked?

Thanks.

Comments

Mahmoud_Rabie

Hi

I hope the following answered thread helps you

Wait popup / spinner

Regards

Mahmoud

Mint-Innit

I've been retro-fitting spinners (waitPopup) to various apps recently that have some slow functions. I've found various different techniques are required depending on the page construction and the desired action when a button is pressed. In your case, I think the following might work:

  1. Move your PL/SQL code to be in the Processing section of the page, not in the DA.
  2. Ensure that the Server-Side condition of the process is set to 'when button pressed' and the name of your button.
  3. Change the button to have a DA with a single true action of Submit. Ensure that 'Show Processing' is ticked. Ensure that the Request/Button name is set to the name used in the processing above.

I have used the above method sucessfully to avoid having to use a javascript call.

As I said I've had to use various different techniques, sometimes using the javascript call, sometimes having pre-processing branches to avoid validation issues, etc. It just depends on the exact page. You have to be careful if there's complex processing including automated DML for example.

What I've found is that with APEX there's ALWAYS a way around things ..... eventually....sometimes after much hair-tearing and anguish.... :-)

Cheers.

christof_b

For me the following worked:

First create a Javascript variable (e.g. waitPopup) on page level under item "Function and Global Variable Declaration".

Then create a DA with 3 actions:

1. Execute Javascript Code: waitPopup = apex.widget.waitPopup();

2. Execute your PL/SQL code and set "Wait for result" to TRUE for this action

3. Execute Javascript Code: waitPopup.remove();

Regards

FatMartinR

Christof, your scenario is right, but the spinner/popup does not show until AFTER step 2 has completed.

We are wanting it to show the moment it is instructed to show at step 1 - but it doesn't work as expected/documented.     I am desperate for a solution, as this is really unworkable as is.

Although Mint-Innit? is right about moving the processing to a process to have the popup show, this is not what is wanted.    It would be inappropriate to do a submit here.

> What I've found is that with APEX there's ALWAYS a way around things ..... eventually....sometimes after much hair-tearing and anguish.... :-)

Yeah, but why does it have to be SO difficult to do the simplest of things ?!?

Tyagi Tushar

You may use loading icon plugin for the same.

Just add the start loading event before the pl ssql code and stop loading event after the code.

- Dynamic Action Plugin - Loading Icon

user1.0

I got around this problem I created a dynamic action that does a "Submit Page" action.

Then I put my PL/SLQ calls to my package/stored procedures in a process.

By default this triggered the spinner.

1 - 8
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 29 2018
Added on Mar 24 2018
8 comments
11,293 views