Skip to main content
Inspiring
January 17, 2011
Answered

Onloading of a CFM page, display a message

  • January 17, 2011
  • 1 reply
  • 1309 views

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 topic has been closed for replies.
    Correct answer Owainnorth

    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.

    1 reply

    Owainnorth
    OwainnorthCorrect answer
    Inspiring
    January 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.

    Inspiring
    January 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.

    meensiAuthor
    Inspiring
    January 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:(