Dynamic Support

The tab navigation bar and page group navigation bar support the ability to dynamically enable/disable and hide/show navigation tabs and navigation pages. This feature is supported using a combination of the dynamic attribute of the navigation-page and navigation-group elements, the loader-registry element and a Java loader implementation.

The Java loader implementation registered in the menu configuration will be called when the tab is first loaded and based on the refresh options configured for a tab. The refresh options are configured in the tab configuration file (.tab). See tab-refresh for more information.

A navigation tab and navigation page can be specified as dynamic in the navigation configuration file (.nav) by adding dynamic="true" to the relevant navigation-page or navigation-group elements.

Where a dynamic attribute is set, a loader-registry is then required and should define the fully qualified classname which implements the curam.util.tab.impl.DynamicNavStateLoader interface.

The DynamicNavStateLoader interface requires one method, loadNavState, to be implemented. The loadMenuState method is passed the following parameters:

The loader implementation must decide which items to disable or hide. The method returns an object that represents the state of the navigation tabs and navigation pages. A state must be set for all identifiers in the list. For more information on this interface, consult the Java Documentation.

Note: The list of navigation identifiers passed to the loadNavState method are only those that have been identified as dynamic by the dynamic attribute on the navigation-page or navigation-group elements.

In addition, a navigation-page and navigation-group element cannot use the same identifier. The identifiers must be unique for all elements within the file.