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. Reference data
13.3.6. <rich:panelMenuGroup>
13.3.7. <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>

Documentation in development

Some concepts covered in this chapter may refer to the previous version of Richfaces, version 3.3.3. This chapter is scheduled for review to ensure all information is up to date.

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. The icons can also be managed using facets.

topGroupExpandedLeftIcon, topGroupExpandedRightIcon

These attributes determine the icons for the top level menu when it is expanded. The related facet is the topGroupExpandedClass facet.

topGroupCollapsedLeftIcon, topGroupCollapsedRightIcon

These attributes determine the icons for the top level menu when it is collapsed. The related facet is the topGroupCollapsedClass facet.

topGroupDisabledLeftIcon, topGroupDisabledRightIcon

These attributes determine the icons for the top level menu when it is disabled. The related facet is the topGroupDisabledClass facet.

topItemLeftIcon, topItemRightIcon

These attributes determine the icons for a top level menu item. The related facet is the topItemClass facet.

topItemDisabledLeftIcon, topItemDisabledRightIcon

These attributes determine the icons for a top level menu item when it is disabled. The related facet is the topItemDisabledClass facet.

groupExpandedLeftIcon, groupExpandedRightIcon

These attributes determine the icons for sub-menus that are not the top-level menu when they are expanded. The related facet is the groupExpandedClass facet.

groupCollapsedLeftIcon, groupCollapsedRightIcon

These attributes determine the icons for sub-menus that are not the top-level menu when they are collapsed. The related facet is the groupCollapsedClass facet.

groupDisabledLeftIcon, groupDisabledRightIcon

These attributes determine the icons for sub-menus that are not the top-level menu when they are disabled. The related facet is the groupDisabledClass facet.

itemLeftIcon, itemRightIcon

These attributes determine the icons for items in the menus. The related facet is the itemClass facet.

itemDisabledLeftIcon, itemDisabledRightIcon

These attributes determine the icons for items in the menus when they are disabled. The related facet is the itemDisabledClass facet.

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