Long page load times

This is a discussion on Long page load times within the Cold Fusion forums in Application Servers & Tools category; Hello. I am running ImageCFC on my site. Users can upload images and then I run the CFC to resize them. It is taking a VERY long time to do this. Is there a good way to let the user know the images are uploading and to be patient. I used to just put in red bold text at the Submit button to "Please be patient as your images upload" but I'm looking for something a little more savvy. I would like to have a page load saying "Upload Successful" or even "Upload in Progress" while the code runs in ...

Go Back   Application Development Forum > Application Servers & Tools > Cold Fusion

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-24-2008, 01:03 PM
idesdema
Guest
 
Default Long page load times

Hello. I am running ImageCFC on my site. Users can upload images and then I
run the CFC to resize them. It is taking a VERY long time to do this. Is
there a good way to let the user know the images are uploading and to be
patient. I used to just put in red bold text at the Submit button to "Please
be patient as your images upload" but I'm looking for something a little more
savvy. I would like to have a page load saying "Upload Successful" or even
"Upload in Progress" while the code runs in the background. Recently I've seen
the pages where you hit submit on a form and the whole browser window darkens
except for a small notification box in the middle of the page that says
something like "In progress" or one of those moving circle graphics or even a
progress bar. Can anyone suggest a solution?


Reply With Quote
  #2  
Old 08-24-2008, 01:09 PM
Ken Ford
Guest
 
Default Re: Long page load times

Disable the submit button and change it to something like working:

<script type="text/javascript">
<!--
var submitted = false;
function SubmitTheForm() {
if(submitted == true) {
return;
}
document.myform.mysubmit.disabled = true;
document.myform.mysubmit.value = 'Image upload in progress..........';
document.myform.submit();
submitted = true;
}
//-->
</script>

<input type="submit" name="mysubmit" id="mysubmit" value="Upload Images"
onclick="SubmitTheForm();">

--
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Fordwebs, LLC
http://www.fordwebs.com


"idesdema" <webforumsuser@macromedia.com> wrote in message
news:g8s48l$o8q$1@forums.macromedia.com...
> Hello. I am running ImageCFC on my site. Users can upload images and
> then I
> run the CFC to resize them. It is taking a VERY long time to do this. Is
> there a good way to let the user know the images are uploading and to be
> patient. I used to just put in red bold text at the Submit button to
> "Please
> be patient as your images upload" but I'm looking for something a little
> more
> savvy. I would like to have a page load saying "Upload Successful" or
> even
> "Upload in Progress" while the code runs in the background. Recently I've
> seen
> the pages where you hit submit on a form and the whole browser window
> darkens
> except for a small notification box in the middle of the page that says
> something like "In progress" or one of those moving circle graphics or
> even a
> progress bar. Can anyone suggest a solution?
>
>


Reply With Quote
  #3  
Old 08-24-2008, 07:50 PM
Dan Bracuk
Guest
 
Default Re: Long page load times

Disabling the submit button is a horrible idea. The simplest way to go about
this is to put a message at the top of your action page and then cffflush it.
You can put animated gifs and such there too.

If you want to get more complicated, there are progress bars out there, but I
don't think they are written in Cold Fusion.

Reply With Quote
  #4  
Old 08-24-2008, 10:08 PM
idesdema
Guest
 
Default Re: Long page load times

Hi Dan. I think this is more along the line of what I wanted to do. So wht
does the cfflush do?

Would it be something like...

<html>
Chunk of design code with message to be patient...


<cfml>
Cfml code here with actions to database
</cfml>

</html>


???

Where does the cfflush go and what does it do exactly? (Never used it)


Reply With Quote
  #5  
Old 08-25-2008, 07:44 AM
Dan Bracuk
Guest
 
Default Re: Long page load times

cfflush puts anything that can be displayed, text, images, etc, onto the client
immediately whether the rest of the page has finished processing or not. It's
a handy way to take away the link/form so that they don't continously click the
button while your code is processing.



Reply With Quote
  #6  
Old 08-27-2008, 11:46 AM
A***
Guest
 
Default Re: Long page load times

ColdFusion Progress Bar

cfflush has some limitations when used with tags like cfcontent, cfcookie,
cfform, cfheader, cfhtmlhead, cflocation, and SetLocale. There may be errors
also when it is used within the body of cfsavecontent, cfquery, and custom
tags.
http://livedocs.adobe.com/coldfusion...mon/html/wwhel
p.htm?context=ColdFusion_Documentation&file=000002 55.htm

Another option is to use your <meta> tag.
Solution:
--> Load a please wait message with an animated gif progress bar
--> refresh with your <meta> tag and
--> exit
<cfif not isDefined('url.loaded') or url.loaded is "no">
<meta http-equiv="refresh" content="8;url=yourPage.cfm?loaded=yes">
<table>
<tr>
<td><p>Retrieving your data. Please wait... </p></td>
<td><img src='yourAnimatedGIF.gif'></td>
</tr>
</table>
<cfexit>
</cfif>

Amend your refresh time as desired.

Reply With Quote
  #7  
Old 08-27-2008, 12:10 PM
Adam Cameron
Guest
 
Default Re: Long page load times

> Disabling the submit button is a horrible idea.

It's a pretty standard approach to preventing double-submits of forms,
actually.


> The simplest way to go about
> this is to put a message at the top of your action page and then cffflush it.


Won't work. No CF code executes until after the web server has finished
receiving the request from the browser. And in this case, the request
includes the file being uploaded.

So your CF stuff to say "hang on whilst that uploads..." isn't going to be
run until after the upload has finishes.

I don't do UI stuff, I'm afraid, so I've devoid of suggestions bar also
asking on a client-side-scripting / design / UI forum (which a CF formum
isn't, really). Although other people here will no-doubt have some ideas.

Did you google about the place to see what other people have done?

--
Adam
Reply With Quote
  #8  
Old 08-27-2008, 01:24 PM
idesdema
Guest
 
Default Re: Long page load times

I don't think this will work will it? On the form submit, that is the page
that hangs, not the recieving page. I also don't want to refresh and page
because I don't want code re-executing.

Basically all I want to do is have a little animated gif popup after Submit is
clicked that says... Please be patient.

Simple request right?

Reply With Quote
  #9  
Old 08-27-2008, 02:06 PM
Ken Ford - *ACE*
Guest
 
Default Re: Long page load times

http://www.fordwebs.com/examples/light-file/index.cfm

--
Ken Ford
Adobe Community Expert Dreamweaver/ColdFusion
Adobe Certified Expert - Dreamweaver CS3
Fordwebs, LLC
http://www.fordwebs.com


"idesdema" <webforumsuser@macromedia.com> wrote in message
news:g942kh$3g3$1@forums.macromedia.com...
>I don't think this will work will it? On the form submit, that is the page
> that hangs, not the recieving page. I also don't want to refresh and page
> because I don't want code re-executing.
>
> Basically all I want to do is have a little animated gif popup after
> Submit is
> clicked that says... Please be patient.
>
> Simple request right?
>


Reply With Quote
  #10  
Old 08-27-2008, 02:29 PM
fober1
Guest
 
Default Re: Long page load times

Hi,
Here's how to do it:
1) include in the page the html for the "busy"-message, but hide it with css
2) as soon as the form gets submitted, execute a javascript function that
shows the message on top (z-index) of the other content

==========EXAMPLE================================= ================
<!DOCTYPE html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD></HEAD>

<SCRIPT language="JavaScript">var child_window= null;
function submit_form(info){
document.getElementById('busy-curtain').style.display= 'block';
document.getElementById('busy-alert').style.display= 'block';
document.getElementById('busy-info').innerHTML= info;
document.getElementById('primary').submit();
}

</SCRIPT>

<style type="text/css">

div#busy-curtain{
top: 0px;
left: 0px;
width: 100%;
height: 100%;
position: absolute;
background-color: #ffffff;
filter: alpha(opacity=80);
opacity: 0.6;
-moz-opacity: 0.6;
display: none;
z-index: 900;
}
div#busy-alert{
position: absolute;
width: 400px;
height: 200px;
margin: -100px 0px 0px -200px;
top: 50%;
left:50%;
border: 2px solid #FFB300;
background-color: white;
display: none;
z-index: 900;
}
div#busy-info{
padding: 20px 60px 20px 60px;
color: #0071B3;
font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size: 16px;
font-weight: bold;
text-align: center;
z-index: 900;
}
</style>

<BODY>
<form id="primary" method="POST" enctype="multipart/form-data">
<TABLE width="100%" height="100%" cellpadding="0" cellspacing="0" border="1">
<TR>
<TD style="width:200px">
<LABEL for="primary_itm_file">File</LABEL>
</TD>
<TD nowrap>
<INPUT type="File" name="primary_itm_file_upload" style="width:100%"
onchange="submit_form('Uploading File')"
>

</TD>
</TR>
</TABLE>

<DIV id="busy-curtain">&nbsp;</DIV>
<DIV id="busy-alert">
<DIV id="busy-info">&nbsp;</DIV>
</DIV>

</BODY>
</HTML>



Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 07:44 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.