How to Use a Command Component to Reset Input Fields

Working with Navigation Components 18-13 Figure 18–6 First-Level Page As you can see, with large hierarchies, this process can be very time consuming and error prone. Instead of creating each of the separate commandNavigationItem components on each page, for larger hierarchies you can use an XMLMenuModel implementation and managed beans to dynamically generate the navigation items on the pages. The XMLMenuModel class, in conjunction with a metadata file, contains all the information for generating the appropriate number of hierarchical levels on each page, and the navigation items that belong to each level. Instead of using multiple commandNavigationItem components within each navigationPane component and marking the current items as selected on each page, you declaratively bind each navigationPane component to the same XMLMenuModel implementation, and use one commandNavigationItem component in the nodeStamp facet to provide the navigation items. The commandNavigationItem component acts as a stamp for navigationPane component, stamping out navigation items for nodes at every level held in the XMLMenuModel object. The JSF navigation model, through the default ActionListener mechanism, is used to choose the page to navigate to when users select a navigation item. For more information about the menu model, see Section 18.6, Using a Menu Model to Create a Page Hierarchy . On any page, to show the user’s current position in relation to the entire page hierarchy, you use the breadCrumbs component with a series of commandNavigationItem components or one commandNavigationItem component as a nodeStamp, to provide a path of links from the current page back to the root page that is, the current nodes in the focus path. For more information about creating a navigational hierarchy using the XMLMenuModel, see Section 18.6, Using a Menu Model to Create a Page Hierarchy . For more information about manually creating a navigational hierarchy, see Section 18.7, Creating a Simple Navigational Hierarchy . Note: If you want to create menus that can be used to cause some sort of change in an application for example, a File menu that contains the commands Open and Delete, then see Chapter 14, Using Menus, Toolbars, and Toolboxes .