
572
Chapter 26: Retrieving and Formatting Data
<table>
<tr>
<th>First Name</th>
<th>Last Name</th>
<th>Salary</th>
</tr>
<cfoutput query="GetEmployees">
<tr>
<td>#FirstName#</td>
<td>#LastName#</td>
<td>#Salary#</td>
</tr>
</cfoutput>
</cfif>
</table>
</body>
</html>
3
Save the file.
4
Return to the form, enter search criteria, and submit the form.
5
If no records match the criteria you specified, the message appears.
Returning results incrementally
You can use the
cfflush
tag to incrementally output long-running requests to the browser before
a ColdFusion page is fully processed. This allows you to 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
cfflush
to display the message, “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
tag on a page, it sends to the browser all of the HTML
headers and any other available HTML. Subsequent
cfflush
tags on the page send only the
output that ColdFusion generates since the previous flush.
You can specify an
interval
attribute to tell ColdFusion to flush the output each time that at
least the specified 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
cfflush
tag in a
cfloop
to incrementally flush data as it becomes available. This format is particularly
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 might not respond if you flush only a very small amount. Similarly, if you use an
interval
attribute, set it for a reasonable size, such as a few hundred bytes or more but not many
thousands of bytes.
Caution:
Because the
cfflush
tag sends data to the browser when it executes, it has several
limitations, including the following: Using any of the following tags or functions on a page anywhere
after the
cfflush
tag can cause errors or unexpected results:
cfcontent
,
cfcookie
,
cfform
,
cfheader
,
cfhtmlhead
,
cflocation
, and
SetLocale
. (These tags and functions normally modify
the HTML header, but cannot do so after a
cfflush
tag, because the
cfflush
sends the header.)
Using the
cfset
tag to set a cookie anywhere on a page that has a
cfflush
tag does not set the
cookie in the browser. Using the
cfflush
tag within the body of several tags, including
cfsavecontent
,
cfquery
, and custom tags, cause errors. If you save Client variables as cookies,
any client variables that you set after a
cfflush
tag are not saved in the browser. You can catch
cfflush
errors, except Cookie errors, with a
cfcatch
type="template"
tag. Catch cookie errors
with
cfcatch
type="Any"
.
Содержание ColdFusion MX
Страница 1: ...Developing ColdFusion MX Applications...
Страница 22: ...22 Contents...
Страница 38: ......
Страница 52: ...52 Chapter 2 Elements of CFML...
Страница 162: ......
Страница 218: ...218 Chapter 10 Writing and Calling User Defined Functions...
Страница 250: ...250 Chapter 11 Building and Using ColdFusion Components...
Страница 264: ...264 Chapter 12 Building Custom CFXAPI Tags...
Страница 266: ......
Страница 314: ...314 Chapter 14 Handling Errors...
Страница 344: ...344 Chapter 15 Using Persistent Data and Locking...
Страница 349: ...About user security 349...
Страница 357: ...Security scenarios 357...
Страница 370: ...370 Chapter 16 Securing Applications...
Страница 388: ...388 Chapter 17 Developing Globalized Applications...
Страница 408: ...408 Chapter 18 Debugging and Troubleshooting Applications...
Страница 410: ......
Страница 426: ...426 Chapter 19 Introduction to Databases and SQL...
Страница 476: ...476 Chapter 22 Using Query of Queries...
Страница 534: ...534 Chapter 24 Building a Search Interface...
Страница 556: ...556 Chapter 25 Using Verity Search Expressions...
Страница 558: ......
Страница 582: ...582 Chapter 26 Retrieving and Formatting Data...
Страница 668: ......
Страница 734: ...734 Chapter 32 Using Web Services...
Страница 760: ...760 Chapter 33 Integrating J2EE and Java Elements in CFML Applications...
Страница 786: ...786 Chapter 34 Integrating COM and CORBA Objects in CFML Applications...
Страница 788: ......
Страница 806: ...806 Chapter 35 Sending and Receiving E Mail...