?
Solved

Loading message in CF?

Posted on 2006-05-19
8
Medium Priority
?
223 Views
Last Modified: 2013-12-24
if a page is loading ie, post post back from, running a query, is they a way in CF that can inform the user the page is loading ie message: page is loading.

i can do this will javascript examples i have found, but is not a real loading message in terms of actually check if the page is loading, most our just timers etc, i want only the message to be displayed when a page is doing something ie loading.

many thanks
0
Comment
Question by:pigmentarts
  • 3
  • 3
  • 2
8 Comments
 
LVL 9

Assisted Solution

by:73Spyder
73Spyder earned 800 total points
ID: 16718764
We use a JS method.

In a .js file we have this:

// Initialize scripting
window.onload = function () {
      
      document.getElementById('waitwarn').style.display = 'none';
      
}


If the cf file we have this.

      <div id="waitwarn" class="red_message" style="display:block;">
      Please wait while the report generates...
      </div>


This is the most effective solution we have used.
      
0
 
LVL 12

Author Comment

by:pigmentarts
ID: 16718858
if i am runn a simple query this would not run?
0
 
LVL 9

Expert Comment

by:73Spyder
ID: 16718901
Could be.  We only use this on pages that we know could take a long time to run.  
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 7

Accepted Solution

by:
bwasyliuk earned 1200 total points
ID: 16719103
I have used javascript extensively myself to fool the user into waiting while something completes, check out this example here:

http://www.dynamicdrive.com/dynamicindex11/xpprogressbar.htm

Even though this is not tied to the page completing in any way - since something is moving, users sit patiently waiting.  The method we have used to implement this is to have the forms post to a very small (quick loading) page, which just takes all the form data and reposts it to the actual destination where processing will be done.

Example:
<form name="myform" method="get" action="inc_progress.cfm">
  <!--- form contents here --->
</form>

On the "inc_progress.cfm" page, there is a set of code like this:

      <form name="generalform" action="<cfoutput>#url.page_get#</cfoutput>" method="get">
      <cfloop index="curr_field" list="#StructKeyList(url)#">
      <input type="hidden" name="<cfoutput>#curr_field#</cfoutput>" value="<cfoutput>#evaluate("url."&curr_field)#</cfoutput>" />
      </cfloop>
      </form>
      <script>
        window.onload = document.generalform.submit();
      </script>

In addition, you include whatever javascript you want to have the scrolling progress bar or other text displayed.

So, the load of the "inc_progress.cfm" page is very fast - and it shows the progress bar while the form posts/gets to the server for the processing (which may take a few seconds/moments).

I have seen some examples where people used cfflush to indicate actual progress in the query or processing that is done, but I have never been able to make cfflush work the way I want (I call stored procedures for all database queries) so I cant provide much more background on the cfflush option.

Let me know if you want me to elaborate on any of the above.
0
 
LVL 12

Author Comment

by:pigmentarts
ID: 16719135
i dont really want to force the user to wait if they dont have to, that would pee me off, but thanks for the example
0
 
LVL 7

Expert Comment

by:bwasyliuk
ID: 16719230
This particular method has worked well for me since the form on the "inc_progress.cfm" page submits immediately on page load.  So if the processing is fast on form handle page, the progress bar is only displayed for a split second and then they are off to the results page.

There is really no waiting if they dont have to.  The wait is entirely dependent on the speed of the form processing on the form handle page.
0
 
LVL 9

Expert Comment

by:73Spyder
ID: 16720286
I agree with bwasyliuk.  Our status bar is only up for a short time with a short query.

0
 
LVL 12

Author Comment

by:pigmentarts
ID: 16727772
ok makes sense, will have a go now. many thanks for your help guys
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question