Accessibility
 
Home > Products > UltraDev > Support > Building Common Applications
Dreamweaver UltraDev Icon Macromedia Dreamweaver UltraDev Support Center - Building Common Applications
Hiding record-display elements

If a user conducts a search and no records are found, the results page will still display the page elements normally used to display records. This section outlines how to hide these elements when not needed.

For example, here's a typical results page displaying records found:

When the search returns no records, however, the page looks as follows:
Using the page above as an example for this article, the first task is to hide the record counter when the search returns no records. Begin by opening your results page in UltraDev. The example page used in this article looks as follows with Live Data turned off:
Next, apply a Show Region server behavior to the record counter. Select the record counter, open the Server Behavior panel (Window > Server Behaviors), click the plus (+) button, and choose Show Region > Show Region If Recordset Is Not Empty, as follows:

Specify the recordset to check for records, then click OK.

A thin, tabbed gray outline appears around the show region, as follows.

Note: The gray "Show If" outline is not visible with Live Data turned on.

Next, you need to hide the table of results when no records are found. If the table doesn't have a repeat region, you can select the whole table and hide it. If the table has a repeat region, the row with the repeat region must be hidden independently from other rows in the table. In our example page, the first row is a heading row and the second row is a repeat region. Therefore, they must be selected and hidden independently as follows.

Apply a Show Region server behavior to the first row in the table. First, select the row on the page. To precisely select the row, click inside the row, then click the right-most <tr> icon on the status bar to select it. Second, click the plus (+) button in the Server Behavior panel (Window > Server Behaviors) and choose Show Region > Show Region If Recordset Is Not Empty. Third, specify the recordset to check for records, then click OK.

Next, apply a Show Region server behavior to the table row with the repeat region. First, select the row (the second row in the example). Second, click the plus (+) button in the Server Behavior panel and choose Show Region > Show Region If Recordset Is Not Empty. Third, specify the recordset to check for records, then click OK.

When you run the page in a browser and no records are found, the page no longer displays the record counter or table.

To Table of Contents Forward to next document