22 December 2008
Familiarity with building dynamic sites in Dreamweaver.
Note: This tutorial was written for Creative Suite 4. Although the screenshots may differ from what you see on your screen, the content is still valid for Creative Suite 5.
Adobe Dreamweaver CS4 enables you to easily create master/detail ColdFusion pages. A master page is a page that lists database records and corresponding links for each record. When the user clicks a link, a detail page opens displaying more information about the record.
This section describes how to create a master page that lists database records. You can use a dynamic table to list the records on a ColdFusion page.
Before you start, make sure you define a ColdFusion data source for your database. For more information, see Database Connections for ColdFusion Developers (CS4) / Database Connections for ColdFusion Developers (CS5) in Dreamweaver Help.
To create a master page:
In the Bindings panel, click the Plus (+) button, select Recordset (Query), and complete the Recordset dialog box. For more information, click the Help button on the dialog box. If you want to write your own SQL statement, click the Advanced button to open the advanced Recordset dialog box.
Make sure the recordset contains all the table columns you need to create your dynamic table. The recordset must also include the table column containing the unique key of each record—that is, the record ID column. In Figure 1, the ARTISTID column contains information that uniquely identifies each record.
Typically, the recordset on the master page extracts a few columns from a database table while the recordset on the detail page extracts more columns from the same table to provide the extra detail. For now, though, simply use the default All columns selection.
The recordset can be defined by the user at runtime. For more information, see Find and display the requested record on the detail page (CS4) / Find and display the requested record on the detail page (CS5) in Dreamweaver Help.
If prompted to save the file, save it as test.cfm. The Master Detail Page Set dialog box appears (see Figure 3).
Select a few fields for the master page. Note that you can specify which field will have the link and what column from the recordset will be used in the link. Specify test_detail.cfm for the detail page name, and select whatever fields you want to display for the detail page. Finally click OK.
After uploading both the master and detail pages to the server, you can open the master page in a browser (see Figure 4).
After clicking the Donolan link on the master page, the detail page opens with more information about the record (see Figure 5).
Tutorials and samples