![]() ![]() ![]() |
||
|
The search and sequential navigation capabilities are features for locating Compass Travel trips. After locating a trip, the trip coordinator must be able to modify or delete it. Additionally, when viewing the detail for a trip, the trip coordinator must be allowed to add a new trip or use the search facility. To enable trip coordinators to do this, you add the following buttons to the Trip Detail page:
As described in Exercise 1: Creating the main application page from the Trip Detail page, it is important to pass the current record ID (tripID
) to the action page to build the proper SQL statement to process the navigation button requests. It is also important to pass the current record ID to the Maintenance Action page. Therefore, you use an HTML input
tag to hide the current recordID
and post it to the maintenanceaction.cfm page.
<cfoutput query="TripQuery">
tag:
<form action="maintenanceaction.cfm" method="post"> <input type="hidden" name="RecordID" value="#tripID#"> <input type="submit" name="btnAdd" value=" Add "> <input type="submit" name="btnEdit" value=" Edit "> <input type="submit" name="btnDelete" value="Delete"> <input type="submit" name="btnSearch" value="Search"> </form>
Note: The current trip record ID (tripID
) is in a hidden field in the form code. This field provides the action page with current record ID that it must have in order to build the query to access the appropriate record in the Trips database table.
http://localhost/cfdocs/getting_started/my_app/tripdetail.cfm?ID=8
Note: If you are using the built-in ColdFusion server, enter localhost:8500
instead of localhost
.
The page appears as follows:
An error occurs because the Maintenance Action page does not exist. The Maintenance Action page is required to process the maintenance button requests. You will develop this page in Lesson 7: Validating Data to Enforce Business Rules.
|
||
![]() ![]() ![]() |