BESTPROOFINGSERVICE.COM

digital proof sheet - www.bestproofingservice.com

Menu


To begin adding pagination features to your site, follow these steps: 1. Place your cursor just below the table that includes the dynamic


data. 2. From the Recordset Paging submenu, available by clicking the Add (+) button in the Server Behaviors panel, select Move to Previous Record. 3. The Move To Previous Record dialog appears similar to Figure 25.34. Select the Create New Link: Previous option from the Link menu and make sure that the rsEmployeeStore recordset is selected from the Recordset menu. Click OK. A new dynamic Previous hyperlink is created. Figure 25.34. Confirm the settings in the Move To Previous Record dialog.   NOTE In the ColdFusion model, a Pass Existing URL Parameters check box appears in this dialog. Enabling this check box ensures that existing URL parameters are preserved when the user clicks the Next and Previous hyperlinks. Furthermore, ColdFusion doesn't support direct paging of records without the use of the Repeating Region Server behaviors first. More on this later in the chapter. 4. Add a space after the Previous hyperlink and repeat steps 2 and 3, this time selecting the Move to Next Record option from the Recordset Paging submenu. When you've finished adding both paging widgets, two hyperlinks (one identified as Previous and one as Next) appear under the table, similar to Figure 25.35. Figure 25.35. Dynamic Previous and Next hyperlinks appear under the table that contains the dynamic image and text. [View full size image] Save your work and test the result in the browser by pressing the F12 key. You should be able to navigate from the first record in the EmployeeStore database to the next record and back. Figure 25.36 shows the record Dorknozzle Hooded Sweat Shirt that appears after Dorknozzle Shirt as a result of clicking Next. Figure 25.36. Clicking the Next hyperlink enables you to cycle through records. [View full size image]   Of course, you should feel free to experiment with the other paging server behaviors. Dreamweaver provides behaviors for moving to the last record and to the first record. If you're using the ASP model, you can also include a text box that allows a user to enter the specific record to jump to. Showing Specific Regions Now that you have added the capability to cycle through the recordset, consider the following problem: Users click Next until they get to the last record and then they are abruptly stopped. They keep clicking Next but nothing happens. The problem is that the users have reached the end of the recordset and they cannot go any further. Of course, the user has no way of knowing that. To fix this, Dreamweaver provides functionality in the form of a group of Show Region behaviors. For example, we can create a region that contains text alerting the users that they have reached the end of the recordset. When the user reaches the recordset's end, the region is displayed. The complete list of Show Region behaviors is given here: NOTE Although the functionality is the same across server models, the names of these server behaviors vary slightly under the ColdFusion and PHP server models.   Show Region if Recordset Is Empty: This behavior can be useful to alert a user that an empty result was returned from the database. Show Region if Recordset Is Not Empty: Use this behavior when you want to populate a table of data from results returned from a recordset if it isn't empty. Show Region if First Record: If users are on the first set of records, you can alert them to this fact.