Linking The Search Results Page To The Trip Detail Page - MACROMEDIA COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX Getting Started

Building coldfusion mx applications
Table of Contents

Advertisement

Linking the Search Results page to the Trip Detail page

In the next exercise you will modify the Trip Search Results page to let the user view the details of
any trip. To do this, you will convert the trip name entries in the results page to links, which will
display the trip's detailed information in the detail page.
Exercise: linking the Search Results page with the Trip Detail page
Use the following steps to link the Trip Search Results page (tripsearchresult.cfm) to the Trip
Detail page (tripdetail.cfm).
To create links between pages:
Open the tripsearchresult.cfm page from the my_app directory and replace the
1
the
cfoutput
<a href="tripdetail.cfm?ID=#URLEncodedFormat(tripID)#">
#tripName# </a>
Note: The URLEncodedFormat is a ColdFusion function that returns a URL-encoded string.
Spaces are replaced with %20, and nonalphanumeric characters with equivalent hexadecimal
escape sequences. The function lets you pass arbitrary strings within a URL, because ColdFusion
automatically decodes URL parameters that are passed to the page.
Save the file and view the tripsearch.cfm page from the my_app directory in your browser.
2
In the Trip Location drop-down list box, select Begins With and type the value C in the trip
3
location text box then click Search.
The Trip Search Results page displays a hyperlink for each trip name listed, as the following
figure shows:
To view the Trip Detail page for a trip, click on 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 next exercise.
block with the following code:
Enhancing the Trip Maintenance application
in
#tripName#
85

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

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion mx

Table of Contents