|
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. |