We help IT Professionals succeed at work.

Displaying "Please Wait" message before LONG query.

adamkerrigan
adamkerrigan asked
on
776 Views
Last Modified: 2013-12-24
I have a long query/process that has to happen to get certain data from my database. My users are assuming that since it is taking so long that it doesn't work. I want to be able to display a message that says "Please Wait" until the query is finished.

This is my process thus far,

FORM -> URL QUERY -> Redirect Page -> URL QUERY -> PAGE WHERE QUERY/PROCESS IS EXECUTED

I wanted to use the redirect page to display the message, so I tried using the <CFFLUSH> tag, but it doesn't seem to complete the <CFLOCATION> that directly follows it:

(example)
<CFOUTPUT>
Please wait, thanks.
</CFOUTPUT>
<CFFLUSH>
<CFLOCATION url="http://www.newloc.com?yadda=yadda">

The "Please wait, thanks." displays and that works, but the process doesn't run. If I take out the flush I don't see the "Please wait, thanks" and the process runs, but it looks broken.


Any help is appreciated. Thanks.
Comment
Watch Question

This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Commented:
adamkerrigan,

What we do, is when they click the action button on the previous page, we use javascript to set the button text from Submit or whatever it says, to Please Wait... and disable the button.

Regards
Plucka
Plucka -- could you show us an example as to how you accomplish that?  

 - Yvan
there are a few ways to do this. the button solution is good for quicker processes, but eventually, you'll get to the next page and have your white screen that users will not know what to do with.

1. instead of a cflocation, which places information in the header to relocate, use a javascript relocation:

<cfflush interval=10>

<p id="loadingText" style="font-size:xx-large;">Loading . . .</p>

<!--- long code --->

<script language="javascript" type="text/javascript">
window.location.href = 'relocationurl';
</script>



2. if you want this all one one page, you can do this :

<cfflush interval=10>

<p id="loadingText" style="font-size:xx-large;">Loading . . .</p>

<!--- long code --->

<script language="javascript" type="text/javascript">
document.getElementById("loadingText").style.display = 'none';
</script>

<!--- the rest of your code --->
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.