Displaying and Hiding Regions


You can add the Show Region server behaviors to display or hide regions of a page. In a page with navigation links, you can add Show Region server behaviors to hide certain links on the first and last pages. For example, you might want to hide the First Page and Previous page links on the first page, and hide the Next Page and Last Page links on the last page. This means that only the appropriate navigation links for any page will be displayed, even if you change the number of records that are displayed on a page.

In the following task, you'll add the Show If Not First Page and Show If Not Last Page server behaviors to a page containing a recordset and navigation links.

To display or hide navigation links:

1.

Open the employees2.cfm page that you created in the previous section, or any dynamic page that includes a recordset and recordset navigation links.

Don't use a page that includes a recordset navigation bar, since it already includes Show Region server behaviors.

2.

In Design view, select the link text for the first page link.

3.

In the Application panel group, click the Server Behaviors tab to access the Server Behaviors panel.

4.

Click the plus (+) button. The Server Behaviors menu appears. Select Show Region > Show If Not First Page (Figure 9.31).

Figure 9.31. Select the Show If Not First Page behavior from the Show Region menu.


The Show If Not First Page dialog appears (Figure 9.32). In the Recordset field, employees is displayed.

Figure 9.32. Hide the First Page link on the first record page with the Show If Not First Page dialog.


5.

Click OK to close the dialog and add the server behavior to the page.

6.

In Design view, select the link text for the previous-page link. Repeat Steps 4 and 5 to add the Show If Not First Page server behavior.

7.

In Design view, select the link text for the next-page link. Click the plus button to access the Server Behaviors menu, and select Show Region > Show If Not Last Page. The Show If Not Last Page dialog appears. Click OK to close the dialog and add the server behavior to the page.

8.

Save the page. Select File > Preview in Browser.

9.

Test the Show Region server behavior by navigating through the record and noting which links appear on the pages.

Tip

  • The Show Region server behavior group includes two additional behaviors (Show If Recordset Is Empty and Show If Recordset Is Not Empty) that enable you to display a specific message if a recordset is empty or if a recordset is not empty. For example, you can use the Show If Recordset Is Empty behavior to let a user know that there are no results from his or her query on a search page. For more information on these additional Show Region behaviors, see Chapter 11.





Macromedia Dreamweaver 8 Advanced for Windows and Macintosh. Visual Quickpro Guide
Macromedia Dreamweaver 8 Advanced for Windows and Macintosh: Visual QuickPro Guide
ISBN: 0321384024
EAN: 2147483647
Year: 2004
Pages: 129
Authors: Lucinda Dykes

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