MACROMEDIA COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 87

Building coldfusion mx applications
Table of Contents

Advertisement

When a query variable is referenced within a
assumed to be the query identified in the QUERY attribute of the
need the
qualifier query_name
previous modulus code example.
For more information about using the modulus function or query variables in ColdFusion
applications, see Developing ColdFusion MX Applications.
Exercise: formatting the display
In this exercise, you format the currency and date fields in the Trip Search Results page and the
Trip Detail page. Additionally, you modify the Trip Search Results page to alternate the
background color of the result table rows.
To format the table:
To format the Trip Detail page dollar and date fields, open the tripdetail.cfm in the my_app
1
directory in your editor and make the following changes:
Existing code
#departureDate#
#returnDate#
#price#
#baseCost#
To format the currency and date fields on the Trips Search Results page, open the
2
tripsearchresult.cfm in your editor and make the same changes for
, and
returnDate
price
To alternate the background color of the rows of the search results table, delete the table row
3
tag
that immediately follows the
<tr>
the following code:
<cfif CurrentRow Mod 2>
<cfset BackColor="White">
<cfelse>
<cfset BackColor="Yellow">
</cfif>
<TR bgcolor= #BackColor#>
Save the files then open your browser and navigate to the tripsearch.cfm page in the my_app
4
directory. Again, enter Begins With and C in the location search criteria, and click Search.
cfoutput
. That is why the
Change to
#dateformat(departureDate, "mm/dd/yyyy")#
#dateformat(returnDate, "mm/dd/yyyy")#
#dollarformat(price)#
#dollarformat(baseCost)#
as in step 1.
<cfoutput query="TripResult">
block, the qualifying
cfoutput
variable is unqualified in the
CurrentRow
departureDate
Enhancing the Trip Maintenance application
is
query_name
tag and does not
,
, and replace it with
87

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents