Adobe COLDFUSION 9 Manual page 721

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Returning results incrementally
You can use the
tag to incrementally display long-running requests to the browser before a ColdFusion page
cfflush
is fully processed. This tag lets you give the user quick feedback when it takes a long time to complete processing a
request. For example, when a request takes time to return results, you can use the
"Processing your request -- please wait." You can also use it to incrementally display a long list as it gets retrieved.
The first time you use the
cfflush
available HTML. Subsequent
previous flush.
You can specify an
interval
number of bytes become available. (The count does not include HTML headers and any data that is already available
when you make this call.) You can use the
available. This format is useful when a query responds slowly with large amounts of data.
When you flush data, make sure that a sufficient amount of information is available, because some browsers do not
respond if you flush only a small amount. Similarly, if you use an
as a few hundred bytes or more, but not many thousands of bytes.
Limitations of the cfflush tag: Because the
limitations, including the following:
• Using any of the following tags or functions on a page anywhere after the
unexpected results:
cfcontent
tags and functions normally modify the HTML header, but cannot do so after a
tag sends the header.)
• Using the cfset tag to set a cookie anywhere on a page that has a
• Using the
tag within the body of several tags, including
cfflush
can cause errors.
• If you save Client variables as cookies, any client variables that you set after a
browser.
• You can catch
errors, except Cookie errors, with a
cfflush
tag.
type="Any"
Example: using the cfloop tag and Rand function
The following example uses the
generation of data for display. It simulates a situation in which it takes time to retrieve the first data and additional
information becomes available slowly.
tag on a page, it sends to the browser all of the HTML headers and any other
tags on the page send only the output that ColdFusion generated after the
cfflush
attribute to tell ColdFusion to flush the output each time that at least the specified
tag in a
cfflush
tag sends data to the browser when it executes, it has several
cfflush
,
,
,
cfcookie
cfform
cfheader
tag and the
random number generating function to artificially delay the
cfloop
Rand
Last updated 8/5/2010
cfflush
tag to incrementally flush data as it becomes
cfloop
attribute, set it for a reasonable size, such
interval
tag can cause errors or
cfflush
,
,
cfhtmlhead
cflocation
cfflush
tag does not set the cookie in the browser.
cfflush
,
cfsavecontent
cfqueryparam
cfflush
tag. Catch cookie errors with a
cfcatch
tag to display the message,
, and
. (These
SetLocale
tag, because the
cfflush
, and custom tags,
tag are not saved in the
cfcatch
716

Advertisement

Table of Contents
loading

Table of Contents