MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 68

Building coldfusion mx applications
Table of Contents

Advertisement

Invoking the new method
To use the new query, you invoke the method that contains the query.
To invoke the new method with the enhanced query:
Open the triplisting.cfm file.
1.
Modify the following code, or do the steps listed in the
2.
<cfinvoke
component="cfdocs.getting_started.my_app.components.gettrips"
method="getBudgetTrips"
returnvariable="budgetTrips">
</cfinvoke>
Save the file.
3.
Let Dreamweaver do it
You can use the Dreamweaver Extensions to create the CFC query and invoke the method that
contains the query from the triplisting.cfm page.
To invoke the enhanced CFC query in Dreamweaver:
Delete the
1.
cfinvoke
Click the Components tab.
2.
Click the + button next to cfdocs.getting_started.my_app.components, and click the + button
3.
next to gettrips.
Select query getBudgetTrips and drag it to the top of the file.
4.
Change the value of the
5.
returnvariable="budgetTrips"
Save the file.
6.
Displaying the results
To display the results of the new query, you refer to the new query in the
include all the columns that you want to display.
To display the results of the enhanced query
Change the output block in the triplisting.cfm file to output all three selected fields from the
1.
enhanced query, as follows:
<cfoutput query="budgetTrips">
#tripName#
departs: #departureDate#
returns: #returnDate#
price: #price#<BR>
</cfoutput>
Change the heading tag in the triplisting.cfm file from
2.
Trip List</h1>.
68
Chapter 6: Lesson 3: Retrieving Data
code block.
to be the name of the query, budgetTrips, as follows:
returnvariable
"Let Dreamweaver do it"
cfoutput
<h1>Trip List</h1>
section.
block and
to
<h1>Budget

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents