Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Onloading of a CFM page, display a message

Contributor ,
Jan 16, 2011 Jan 16, 2011

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

1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Guide , Jan 17, 2011 Jan 17, 2011

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.

Translate
Guide ,
Jan 17, 2011 Jan 17, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 17, 2011 Jan 17, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 17, 2011 Jan 17, 2011

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:(

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 17, 2011 Jan 17, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 20, 2011 Jan 20, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 20, 2011 Jan 20, 2011
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Jan 17, 2011 Jan 17, 2011

Yes, I will check this one.. but this tag has got so much restriction..


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Jan 17, 2011 Jan 17, 2011

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources