Adobe COLDFUSION 9 Manual page 860

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Manual mode
In the manual mode, you specify the duration the progress bar takes to complete the display of progress.
In the following example,
autodisplay
page is first loaded. When the page is loaded,
bar. The default interval used in this mode is one second.
<head>
<script>
var init = function()
{
document.getElementById('cfpbLabel').style.display = 'block';
ColdFusion.ProgressBar.show('pBar');
ColdFusion.ProgressBar.start('pBar');
}
var hideProgessBar = function(){
document.getElementById('cfpbLabel').style.display = 'none';
ColdFusion.ProgressBar.hide('pBar');
}
</script>
</head>
<cfform>
<div id="cfpbLabel" style="display:none">
Saving File:
</div>
<cfprogressbar
name="pBar"
duration="10000"
autodisplay=false
onComplete="hideProgessBar"
width="400"
/>
<cfset ajaxOnLoad('init')>
</cfform>
Working with a progress bar at runtime
This section illustrates how to use the JavaScript API to update the progress bar status. The following CFM code loads
a progress bar using the JavaScript API ColdFusion.ProgressBar.updatestatus.
On program load,
function displays the progress bar and calls the getProgressData JavaScript function to
intit
manually update the progress bar. The getProgressData function assigns the status and message variables passed to the
JavaScript API update status.
While working with a progress bar at runtime, ensure that you specify a dummy duration (for instance,
). Even though the custom JavaScript function decides the actual duration,
duration=5000
attribute.
is set to
as a result of which the progress bar is not shown when the
false
function is invoked and the function displays and runs the progress
init
Last updated 8/5/2010
855
is a mandatory
duration

Advertisement

Table of Contents
loading

Table of Contents