DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
• Uses callback and error handlers that give control to the users after the progress bar completes processing or if it
encounters any exceptions.
• Lets programmatic control over progress bar using JavaScript APIs.
Progress bar modes
The progress bar supports the following two modes:
Dynamic mode
User specifies the bind expression to provide data for the progress bar to display. The
function that determines the indicator length.
The following CFM code shows how to use a CFC bind expression:
<cfajaxproxy cfc="pbar" jsclassname="pbar">
<head>
<script>
var utils = new pbar();
var count = 0;
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');
utils.resetStatus();
}
</script>
</head>
<cfform>
<div id="cfpbLabel" style="display:none">
Saving File:
</div>
<cfprogressbar
name="pBar"
autodisplay=false
bind="cfc:pbar.getProgessData()"
onComplete="hideProgessBar"
width="400">
<cfset ajaxOnLoad('init')>
</cfform>
The following pb.cfc has the function that returns data for the progressbar:
Last updated 1/20/2012
attribute specifies a
bind
852