JBoss.orgCommunity Documentation

Chapter 12. Menus and toolbars

12.1. <rich:dropDownMenu>
12.1.1. Basic usage
12.1.2. Menu content
12.1.3. Appearance
12.1.4. Expanding and collapsing the menu
12.1.5. Reference data
12.1.6. Style classes and skin parameters
12.2. Menu sub-components
12.2.1. <rich:menuItem>
12.2.2. <rich:menuGroup>
12.2.3. <rich:menuSeparator>
12.3. <rich:panelMenu>
12.3.1. Basic usage
12.3.2. Interactivity options
12.3.3. Appearance
12.3.4. Submission modes
12.3.5. <rich:panelMenu> server-side events
12.3.6. JavaScript API
12.3.7. Reference data
12.3.8. Style classes and skin parameters
12.3.9. <rich:panelMenuGroup>
12.3.10. <rich:panelMenuItem>
12.4. <rich:toolbar>
12.4.1. Basic usage
12.4.2. Appearance
12.4.3. Grouping items
12.4.4. Reference data
12.4.5. Style classes and skin parameters
12.4.6. <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 12.1. <rich:dropDownMenu>


Table 12.1. Style classes (selectors) and corresponding skin parameters

Class (selector)Skin ParametersMapped CSS properties
.rf-ddm-lbl

This class defines styles for the label of the drop-down menu.

headerFamilyFont

font-family

.rf-ddm-dis

This class defines styles for the drop-down menu when it is disabled.

tabDisabledTextColor

color

.rf-ddm-lbl-dis

This class defines styles for the label of the drop-down menu when it is disabled.

headerFamilyFont

font-family

.rf-ddm-pos

This class defines the positioning of the drop-down menu.

No skin parameters.
.rf-ddm-lbl-unsel

This class defines styles for the label of the drop-down menu when it is unselected.

No skin parameters.
.rf-ddm-lst

This class defines styles for the drop-down list.

panelBorderColor

border-color

additionalBackgroundColor

background-color

.rf-ddm-lst-bg

This class defines styles for the background of the drop-down list.

additionalBackgroundColor

border-color

.rf-ddm-sublst

This class defines the positioning of the menu when used as a sub-menu.

No skin parameters.
.rf-ddm-itm

This class defines styles for a menu item.

generalFamilyFont

font-family

generalSizeFont

font-size

.rf-ddm-itm-sel

This class defines styles for a menu item when it is selected.

headerBackgroundColor

border-color

tabBackgroundColor

background-color

.rf-ddm-itm-unsel

This class defines styles for a menu item when it is unselected.

No skin parameters.
.rf-ddm-itm-dis

This class defines styles for a menu item when it is disabled.

tabDisabledTextColor

color

.rf-ddm-itm-lbl

This class defines styles for the label in a menu item.

generalTextColor

color

.rf-ddm-itm-ic

This class defines styles for the icon in a menu item.

No skin parameters.
.rf-ddm-emptyIcon

This class defines styles for an empty icon in a menu item.

No skin parameters.
.rf-ddm-sep

This class defines styles for a menu separator.

panelBorderColor

border-top-color

.rf-ddm-nd

This class defines styles for a menu node.

No skin parameters.

The <rich:menuItem>, <rich:menuGroup>, and <rich:menuSeparator> components are used to construct menus for the <rich:dropDownMenu> component. Refer to Section 12.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 12.2, “richpanelMenu” demonstrates the use of icon declaration at the panel menu level. The standard icons are shown in Figure 12.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.

Table 12.2. Style classes (selectors) and corresponding skin parameters

Class (selector)Skin ParametersMapped CSS properties
.rf-pm

This class defines styles for the panel menu itself.

No skin parameters.
.rf-pm-gr

This class defines styles for a panel menu group.

panelBorderColor

border-top-color

.rf-pm-exp, .rf-pm-colps

These classes define styles for the panel menu when it is expanded or collapsed.

No skin parameters.
.rf-pm-ico

This class defines styles for the panel menu icons.

No skin parameters.
.rf-pm-ico-exp, .rf-pm-ico-colps

These classes define styles for the panel menu icons when they are expanded or collapsed.

No skin parameters.
.rf-pm-hdr-exp, .rf-pm-hdr-colps

These classes define styles for the panel menu headers when they are expanded or collapsed.

No skin parameters.
.rf-pm-itm

This class defines styles for a panel menu item.

panelBorderColor

border-top-color

generalTextColor

color

.rf-pm-itm-gr

This class defines styles for a panel menu item as part of a panel menu group.

No skin parameters.
.rf-pm-itm:hover

This class defines styles for a panel menu item when the mouse hovers over it.

additionalBackgroundColor

background-color

.rf-pm-itm-sel

This class defines styles for a panel menu item when it is selected.

No skin parameters.
.rf-pm-itm-dis

This class defines styles for a panel menu item when it is disabled.

tabDisabledTextColor

color

.rf-pm-itm-ico

This class defines styles for the icon in a panel menu item.

No skin parameters.
.rf-pm-itm-exp-ico

This class defines styles for the icon in a panel menu item when it is expanded.

No skin parameters.
.rf-pm-itm-lbl

This class defines styles for the label in a panel menu item.

generalSizeFont

font-size

generalFamilyFont

font-family

.rf-pm-gr

This class defines styles for a panel menu group.

panelBorderColor

border-top-color

.rf-pm-gr-gr

This class defines styles for a panel menu group as part of another panel menu group.

No skin parameters.
.rf-pm-gr-sel

This class defines styles for a panel menu group when it is selected.

No skin parameters.
.rf-pm-gr-hdr

This class defines styles for the header of a panel menu group.

generalTextColor

color

.rf-pm-gr-hdr:hover

This class defines styles for the header of a panel menu group when the mouse hovers over it.

additionalBackgroundColor

background

.rf-pm-gr-hdr-dis

This class defines styles for the header of a panel menu group when it is disabled.

tabDisabledTextColor

color

.rf-pm-gr-ico

This class defines styles for the icon in a panel menu group.

No skin parameters.
.rf-pm-gr-exp-ico

This class defines styles for the icon in a panel menu group when it is expanded.

No skin parameters.
.rf-pm-gr-lbl

This class defines styles for the label in a panel menu group.

generalSizeFont

font-size

generalFamilyFont

font-family

.rf-pm-gr-cnt

This class defines styles for the content of a panel menu group.

No skin parameters.
.rf-pm-top-itm

This class defines styles for the top panel menu item.

panelBorderColor

border-color

generalTextColor

color

.rf-pm-top-itm-gr

This class defines styles for the top panel menu item as part of a panel menu group.

No skin parameters.
.rf-pm-top-itm:hover

This class defines styles for the top panel menu item when the mouse hovers over it.

headerTextColor

color

.rf-pm-top-itm-sel

This class defines styles for the top panel menu item when it is selected.

No skin parameters.
.rf-pm-top-itm-dis

This class defines styles for the top panel menu item when it is disabled.

tabDisabledTextColor

color

.rf-pm-top-itm-ico

This class defines styles for the icon in the top panel menu item.

No skin parameters.
.rf-pm-top-itm-exp-ico

This class defines styles for the icon in the top panel menu item when it is expanded.

No skin parameters.
.rf-pm-top-itm-lbl

This class defines styles for the label in the top panel menu item.

generalSizeFont

font-size

generalFamilyFont

font-family

.rf-pm-top-gr

This class defines styles for the top panel menu group.

panelBorderColor

border-color

.rf-pm-top-gr-gr

This class defines styles for the top panel menu group as part of another panel menu group.

No skin parameters.
.rf-pm-top-gr-sel

This class defines styles for the top panel menu group when it is selected.

No skin parameters.
.rf-pm-top-gr-hdr

This class defines styles for the header of the top panel menu group.

headerTextColor

color

headerBackgroundColor

background-color

.rf-pm-top-gr-hdr-dis

This class defines styles for the header of the top panel menu group when it is disabled.

tabDisabledTextColor

color

additionalBackgroundColor

background-color

.rf-pm-top-gr-ico

This class defines styles for the icon in the top panel menu group.

No skin parameters.
.rf-pm-top-gr-exp-ico

This class defines styles for the icon in the top panel menu group when it is expanded.

No skin parameters.
.rf-pm-top-gr-lbl

This class defines styles for the label in the top panel menu group.

generalSizeFont

font-size

generalFamilyFont

font-family

.rf-pm-top-gr-cnt

This class defines styles for the content of the top panel menu group.

No skin parameters.

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