Solved

Page preloader when large amounts of data are loading.

Posted on 2007-11-26
2
559 Views
Last Modified: 2013-12-24
I have several complicated report with large <Cfquery's
I need a page preloader, as they can take several seconds to load.
i have tried the java ones, however they start after the CFQuerys

any ideas how to get  a preloader to work
0
Comment
Question by:kleigh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Expert Comment

by:debuggerau
ID: 20355579
display a page with a query to load the report into the next page would just require javascript.

After a few seconds load this page........
http://www.tizag.com/javascriptT/javascriptredirect.php
0
 
LVL 9

Accepted Solution

by:
digicidal earned 500 total points
ID: 20370267
What I have done is created a <DIV> that contains the loading page display, and then a second div that contains the rest of the page with the report in it.  Use CFFLUSH in between to force the first part of the page to display immediately... that will cause the loading DIV to display... and the rest of the page to process... then at the bottom of the page (the very bottom) add a javascript function to make that display div invisible.

I haven't actually used it for queries, but there are examples of this in the CFFLUSH documentation, however I have used it where I had a great deal of DHTML being done for a huge record set that had collapseable/expandable regions in the output.  Essentially I made an expand and collapse function for each header row as well as 4 dynamic functions controlling inline calls for each record to popup images of invoices, purchase history, stats, etc..  Since this because a HUGE page on large record sets it would appear that the browser had timed out - but it was actually still downloading the page text itself.   Because this took 20secs to 2mins depending on the browser and machine used to view the page, I added the loading div.  Here's a (truncated) example:
<div id="pleaseWaitMsg" align="center" style="padding:10px; border:2px solid #FFCC00; font-size:12px;">Please be patient... Preparing Display.</div>
<div class="label_2">Billing Documents</div>
	<div style="margin-top:3px; margin-bottom:3px;">
	<script language="javascript">
	// HERE I DO ALL OF MY TOP LEVEL FUNCTIONS.
	</script>
	<cfoutput query="qMyQuery.BillingData" group="CustomerName">
		<script language="javascript">
		// HERE I DO ALL OF MY SECOND LEVEL DYNAMIC JAVASCRIPT FUNCTIONS.
		</script>
		<div>
			<!--- Header (Cust) Grouping Data Output--->
		</div>
		<cfoutput>
			<script language="javascript">
			// HERE I DO ALL OF MY RECORD LEVEL DYNAMIC JAVASCRIPT FUNCTIONS.
			</script>
			<div>
				<!--- Individual ROW output for this group--->
			</div>
		</cfoutput>
	</cfoutput>
	</div>
<script language="javascript">
	document.getElementById('pleaseWaitMsg').style.display="none";
</script>

Open in new window

0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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