Sorry I fail to see the connection between my issue and the thread suggested.
I'm not sure if there is anything you can do. The submit occurs but nothing gets sent back. There is no hook for this. I don't know how you'd check this condition. Wouldn't it be an alternative to not do the loading icon, and open the page with the export in a url with target="_blank" so it doesn't disturb the current screen?
We would love to help but you left out one crucial part of the puzzle: namely how does your CSV report get exported. With the way it is setup (a redirect to another page), I'm going to assume you do that because you have some PL/SQL on that page that prints the CSV.
Now there are two questions that are crucial here:
- How do we stop the icon from bugging us on the screen
- How do we communicate with the browser that it should no longer display the loading icon
The first question is rather easy, two simply lines of codes can do that:
But when do we use this code? Quite simple when the document is downloaded. When is it downloaded? At the end of the PL/SQL code that prints the document to the browser.
What you could do is at the end of that code give an application item a certain value. For example :AI_PRINTED := 'Y';
Better would be a Server send event, but since you left out another crucial piece of information: your browser, I will not go deeper into this.
Start this timing event when someone asks for the document, and end it as soon as the process returns that :AI_PRINTED equals 'Y'.
Despite the lack of information, I hope I have given, or at least inspired you to get to the solution.
Many thanks for your reply. Here are the bits of information your mentioned that were crucial to the puzzle.
1) My browser is IE 9.0.8112 or Firefox 25.0.1
2) To export a report directly to CSV is very simple and there is no need to write any PLSQL. In a normal (classic) report that renders as a visable report you write the SQL and apply an appropriate report tempate but in the case of a report that does not render but immediately prompts you to save the output to CSV format, all you have to do is apply the report template called, " Export:CSV". No code is needed. I have the visible version of the report output on page 1 and the exportable version (slightly different i.e. no breaks) on page 2. Navigating to page 2 immediately brings up the standard open/save window's dialog box asking to open or save the generated CSV file.
It's very simple.
Problem is getting focus back on page 1 and clearing the grey screen and the animated loading gif which were initiated by a Dynamic Action defined button with "Show Processing on Submit" checked.
So the question is, where should I put the code you suggested?:
Well so the hard part is you don't know when exactly your report is downloaded, because the APEX code is doing this for you.
Meaning if you want to keep your waiting popup you need to code the download in PL/SQL so you can detect when the download is complete.