Adding Multiple Menus to a Page

Solution Approach

In some applications it’s useful to have more than one menu bar in order to add additional navigation or simply to break up an otherwise large menu into several smaller ones.  Individual menus can be placed anywhere on the page.

Procedure

To add a second menu to a page:

Step 1:  Create a new layout page file for the Menu.  Include the menu items in both the normal and highlighted states.  You might review the example that shows how to build reusable menu panels in Part VI of the online help.

Copy and paste the relevant layout elements and then change the names of the new items, similar to the MenuItem2 and MenuItem2Hilited tags below.

     <tr>

          <td><GEN:Button Name="MenuItem" File="Menu_Item.html"/></td>

          <td><GEN:Button Name="MenuItemHilited" File="Menu_Item_Highlighted.html"/></td>

          <td><GEN:Button Name="MenuItem2" File="Menu_Item.html"/></td>

          <td><GEN:Button Name="MenuItem2Hilited" File="Menu_Item_Highlighted.html"/></td>

     </tr>

Step 2:  Insert a “<GEN:Use Type=”Menu” />” code generation tag into each of your layout pages where you would like the menus placed.

Step 3:  Configure the menus using the Page Properties dialog.

Tag Property

Setting

Code generation tag

MenuItem2

Button Text

Save

Validate page data

True

Button Command

Save data on page

This indicates to the application that data must be added or updated in the database.  Do not change the command name from Update Data, otherwise the updated data will not be saved in the database.

URL

Back

Optionally, you can specify the URL of the current page to refresh the browser with the same page.

 

Tag Property

Setting

Code generation tag

MenuItem2Hilited

Button Text

Save

Validate page data

True

Button Command

Save data on page

This indicates to the application that data must be added or updated in the database.  Do not change the command name from Update Data, otherwise the updated data will not be saved in the database.

URL

Back

Optionally, you can specify the URL of the current page to refresh the browser with the same page.

Step 4:  Additionally, you must set a pass-through attribute for MenuItem2Hilited in the Properties tab in the Page Properties dialog.  Set the Visible attribute to “False”.  Otherwise, both the MenuItem2 and MenuItem2Hilited tabs will be visible when you run the application.

Attribute

Value

Code generation tag

MenuItem2Hilited

Visible

False

Step 5:  Specify the HighlightSettings attribute on each of the layout pages to designate the current menu item.

Step 6:  Build and run the application.

See Also

Menus