Copy link to clipboard
Copied
Hi all,
I have a cfm page which has a submit button, on clicking of that, it will open a new window, where a report will be generated in that.
The problem is the report generation(cfquery) taking long time to load;(nearly 4 minutes).. Initially with the help of CSS , in the new window, I had "Please be patient, while the report generation is in process".. this message comes before the 15 seconds (of the report generation).. So for the first 3 minutes, I m having a blank screen..
I want to have this message for the first 3 minutes also.
Your help needed..
Thanks in advance
This sounds like a case for... CFFLUSH!
As the A-Team weren't available due to a dispute with their union.
CFFLUSH pushes the current page to the browser as far as it's rendered. There are a few exceptions where it won't work, but it'd be a fair place to start.
Copy link to clipboard
Copied
This sounds like a case for... CFFLUSH!
As the A-Team weren't available due to a dispute with their union.
CFFLUSH pushes the current page to the browser as far as it's rendered. There are a few exceptions where it won't work, but it'd be a fair place to start.
Copy link to clipboard
Copied
In addition to Owain's answer, if you put your message in a div tag, then you can clear that tag with javascript when the rest of the page loads.
You might want to look at your query though. If it's taking four minutes, it might not be written as well as it could be.
Copy link to clipboard
Copied
Hi Dan,
<body style="background-color: White;" onLoad="showContent()">
<script type="text/javascript">
document.write('<div id="loading">Generating report.... Please be patient.</div>');
</script>
<div id="content">
<script type="text/javascript">
//hide content
document.getElementById("content").style.display='none';
</script>
function showContent(){
//hide loading status...
document.getElementById("loading").style.display='none';
//show content
document.getElementById("content").style.display='block';
}
This is what I'm using; but this message is shown to the user at the end.
client need to show this message when the request hits the CF server; if you see the progress bar is half done and after this only the message shown.
The requirement is show the message when the progress bar starts:(
Copy link to clipboard
Copied
When you clear the div, don't make it a function. Just do this.
content
<script>
document.getElementById("loading").style.display='none';
</script>
Or use the body onLoad event.
Copy link to clipboard
Copied
I m using the onLoad of the Body tag event, its working.
but the requirement is when the progress bar starts itself, they want to display some image.. in my case, the message comes when the progress bar is half done.
Any solutions will be highly appreciated.!!!
Thanks.
Copy link to clipboard
Copied
There's no way of doing a proper progress bar, as a user's browser has no concept of what's going on at the server or vice versa.
If you knew roughly the time it would take you could mock one up in Javascript that ticks away by itself, but it won't be accurate.
Copy link to clipboard
Copied
Yes, I will check this one.. but this tag has got so much restriction..
Copy link to clipboard
Copied
True, but it's the only way of sending data to a browser before the page has finished loading.
Only other option might be to complete the task in a separate thread and ask the user to check back later rather than keeping them waiting.