System information

Exercise 3: Constructing the initial Trip Search Results page 79
Exercise 3: Constructing the initial Trip Search Results page
After the user enters the search criteria and submits the form, the results are posted to the Trip
Search Results page, as the following figure shows:
The logic contained in the search results page, also known as the action page, invokes the CFC
method that builds the SQL SELECT statement contained in a
cfquery tag by using
ColdFusion string manipulation. The action page displays the result using the
cfoutput tag.
To create the Trip Search Results page:
1.
Create a blank document and save it as tripsearchresult.cfm in the my_app directory.
Note: If you are using Dreamweaver, select Dynamic page in the Category list, and ColdFusion in
the Dynamic Page list.
2.
Enter the following code, or do the steps in the “Let Dreamweaver do it section.
<cfinvoke
component="cfdocs.getting_started.my_app.components.gettrips"
method="getTripsFromForm"
returnvariable="TripResult">
</cfinvoke>
3.
Enter or copy and paste the following code after the closing cfinvoke tag:
<html>
<head>
<title>Trip Maintenance - Search Results</title>
</head>
<body>
<img src="images/tripsearchresults.gif">
<table border="0" cellpadding="3" cellspacing="0">
<tr bgcolor="Gray">
<td>Trip Name
</td>
<td>Location
</td>
<td>Departure Date
</td>
<td>Return Date
</td>
<td>Price