Exercise 4: Enhancing The Look Of The Trip Search Results And Trip Detail - MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started

Building coldfusion mx applications
Table of Contents

Advertisement

To test the revised page:
View the tripsearchform.cfm page from the my_app directory in your browser.
1.
In the Trip Location drop-down list, select Begins With, and enter the value C.
2.
Click Search.
3.
The Trip Search Results page displays a hyperlink for each trip name, as the following figure
shows:
To view the Trip Detail page for a trip, click the trip name.
4.
You might notice that the dates and prices in both the Trip Detail and Trip Search Results pages
are unformatted. You will improve the appearance of the application in
the look of the Trip Search Results and Trip Detail pages" on page
Exercise 4: Enhancing the look of the Trip Search Results and
Trip Detail pages
The Trip Maintenance application now provides a useful drill-down mechanism for locating trips.
Although this application is functionally sound, its appearance could be improved, including
formatting dates and dollar amounts, and making long lists easier to read.
Formatting dates and dollar amounts
ColdFusion provides several functions to improve application appearance. These include the
and
DateFormat
To format the dates and dollar amounts:
To format the Trip Detail page dollar and date fields, open the tripdetail.cfm file in the my_app
1.
directory in your editor and make the following changes:
Existing code
#departureDate#
#returnDate#
#price#
#baseCost#
functions that format dates and currency variables.
DollarFormat
Replacement code
#DateFormat(departureDate, "mm/dd/yyyy")#
#DateFormat(returnDate, "mm/dd/yyyy")#
#DollarFormat(price)#
#DollarFormat(baseCost)#
Exercise 4: Enhancing the look of the Trip Search Results and Trip Detail pages
"Exercise 4: Enhancing
93.
93

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents