Building MasterDetail Pages

Building Master/Detail Pages

As we mentioned, Dreamweaver MX helps you quickly create master and detail pages that allow a user to drill down to find the most relevant information. Let's begin with a brief look at the master/detail structure you'll need to implement, whether using built-in Server Behaviors or scripting your own components, and then move on to build examples using the various Dreamweaver-compatible tools.

A master page lists records held in a recordset. Each of these records is displayed with a link to a record detail page that displays more information about the record the user clicked in the master page. To create a master page, you need several elements: a connection to your database, a recordset of data, and a link between each displayed record on the master page to that more comprehensive record on the detail page. As well, the detail page requires a connection to your database and a recordset of data filtered to show only the record passed from the master page. Figure 21.1 shows this process visually.


Figure 21.1: The Master/Detail modelDatabase

The glue that binds the master and detail pages is the link the user clicks on the master page to view the detail page. This link tells the detail page which record the user has clicked so that the detail page can display more information about that record. To allow the detail page to know which record detail to display, the master page must pass some record identification value in a variable to the detail page. The best way to identify which record was clicked on the master page and which record should be displayed on the detail page is to pass a variable containing the primary key of the record. For example, if the master page displays three records from our tblCategories table, each record passes its primary key to the detail page. The detail page catches the primary key and looks up the record information for only that record. This may sound complex, but creating a master/detail page set is simple using Dreamweaver MX.



Mastering Dreamweaver MX Databases
Mastering Dreamweaver MX Databases
ISBN: 078214148X
EAN: 2147483647
Year: 2002
Pages: 214

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net