JBoss.orgCommunity Documentation

Chapter 13. Menus and toolbars

13.1. <rich:dropDownMenu>
13.1.1. Basic usage
13.1.2. Menu content
13.1.3. Appearance
13.1.4. Expanding and collapsing the menu
13.1.5. Reference data
13.2. Menu sub-components
13.2.1. <rich:menuItem>
13.2.2. <rich:menuGroup>
13.2.3. <rich:menuSeparator>
13.3. <rich:panelMenu>
13.3.1. Basic usage
13.3.2. Interactivity options
13.3.3. Appearance
13.3.4. Submission modes
13.3.5. <rich:panelMenu> server-side events
13.3.6. JavaScript API
13.3.7. Reference data
13.3.8. <rich:panelMenuGroup>
13.3.9. <rich:panelMenuItem>
13.4. <rich:toolbar>
13.4.1. Basic usage
13.4.2. Appearance
13.4.3. Grouping items
13.4.4. Reference data
13.4.5. <rich:toolbarGroup>

Read this chapter for details on menu and toolbar components.

The <rich:dropDownMenu> component is used for creating a drop-down, hierarchical menu. It can be used with the <rich:toolbar> component to create menus in an application's toolbar.

Figure 13.1. <rich:dropDownMenu>


The <rich:menuItem>, <rich:menuGroup>, and <rich:menuSeparator> components are used to construct menus for the <rich:dropDownMenu> component. Refer to Section 13.1, “<rich:dropDownMenu>” for more details on the <rich:dropDownMenu> component.

The <rich:menuItem> component represents a single item in a menu control. The <rich:menuItem> component can be also be used as a seperate component without a parent menu component, such as on a toolbar.

The <rich:panelMenu> component is used in conjunction with <rich:panelMenuItem> and <rich:panelMenuGroup> to create an expanding, hierarchical menu. The <rich:panelMenu> component's appearance can be highly customized, and the hierarchy can stretch to any number of sub-levels.


Icons for the panel menu can be chosen from a set of standard icons. Icons can be set for the top panel menu, child panel menus, and child item. There are three different menu states that the icon represents, as well as icons for both the left and right side of the item title.

Example 13.2, “richpanelMenu” demonstrates the use of icon declaration at the panel menu level. The standard icons are shown in Figure 13.2, “<Standard icons>”.


Alternatively, point the icon attributes to the paths of image files. The image files are then used as icons.

Any icons specified by child <rich:panelMenuGroup> and <rich:panelMenuItem> components overwrite the relevant icons declared with the parent <rich:panelMenu> component.

The <rich:panelMenuGroup> component defines a group of <rich:panelMenuItem> components inside a <rich:panelMenu>.

Icons for the menu group are inherited from the parent <rich:panelMenu> component. Refer to Section 13.3.3, “Appearance” for details on icon attributes and facets. Alternatively, the menu group's icons can be re-defined at the <rich:panelMenuGroup> component level, and these settings will be used instead of the parent component's settings.

The <rich:panelMenuItem> component represents a single item inside a <rich:panelMenuGroup> component, which is in turn part of a <rich:panelMenu> component.

Icons for the menu item are inherited from the parent <rich:panelMenu> or <rich:panelMenuGroup> component. Refer to Section 13.3.3, “Appearance” for details on icon attributes and facets. Alternatively, the menu item's icons can be re-defined at the <rich:panelMenuItem> component level, and these settings will be used instead of the parent component's settings.

The <rich:toolbar> component is a horizontal toolbar. Any JavaServer Faces (JSF) component can be added to the toolbar.

Figure 13.3. <rich:toolbar>


Set the width and height of the toolbar using the common width and height attributes.

Items on the toolbar can be separated by a graphical item separator. Use the itemSeparator attribute to specify one of the standard separator styles:

Alternatively, use the itemSeparator attribute to specify a URL to an image. The image is then used as an item separator. The appearance of the item separator can be additionally customized by using the itemSeparator facet.

The <rich:toolbarGroup> component is a child component of the <rich:toolbar> component. The <rich:toolbarGroup> component is used to group a number of items together on a toolbar.