### Create new RichFaces Documentation Jira issue

Summary
255 characters left
Description
Environment
This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.org Community Documentation

- Prev
- Next

### 6.8.3. < rich:menuGroup > available since 3.0.0

expand all

#### 6.8.3.1. Description

The <rich:menuGroup> component is used to define an expandable group of items inside a pop-up list or another group.

Figure 6.60. <rich:menuGroup> component

#### 6.8.3.2. Key Features

- Highly customizable look-and-feel

- Grouping of any menu's items

- Pop-up appearance event customization

- Support for disabling

- Smart user-defined positioning

#### 6.8.3.3. Details of Usage

The "value" attribute defines the text representation of a group element in the page.

The "icon" attribute defines an icon for the component. The "iconDisabled" attribute defines an icon for when the group is disabled. Also you can use the "icon" and "iconDisabled" facets. If the facets are defined, the corresponding "icon" and "iconDisabled" attributes are ignored and the facets' contents are used as icons. This could be used for an item check box implementation.

Here is an example:

    ...

    <f:facet name="icon">

            <h:selectBooleanCheckbox value="#{bean.property}"/>

    </f:facet>

    ...

The "iconFolder" and "iconFolderDisabled" attributes are defined for using icons as folder icons. The "iconFolder" and "iconFolderDisabled" facets use their contents as folder icon representations in place of the attribute values.

The "direction" attribute is used to define which way to display the menu as shown in the example below:

Possible values are:

- "left - down" - a submenu is attached to the left side of the menu and is dropping down

- "left - up" - a submenu is attached to the left side of the menu and is dropping up

- "right - down" - a submenu is attached to the right side of the menu and is dropping down

- "right - up" - a submenu is attached to the right side of the menu and is dropping up

- "auto - smart" positioning activation

By default, the "direction" attribute is set to "auto".

Here is an example:

    ...

    <rich:menuGroup value="Save As..." direction="left-down">

            <rich:menuItem   submitMode="ajax" value="Text File"  action="#{ddmenu.doSaveText}"/>

            <rich:menuItem   submitMode="ajax" value="PDF File"  action="#{ddmenu.doSavePDF}"/>

    </rich:menuGroup>

    ...

This would be the result:

Figure 6.61. Using the "direction" attribute

## Note:

The <rich:menuGroup> component was designed to be used only for pop-up menu list creation.

#### 6.8.3.4. Reference Data

Table of <rich:menuGroup> attributes.

Table 6.81. Component Identification Parameters

Name | Value
--- | ---
component-type | org.richfaces.MenuGroup
component-class | org.richfaces.component.html.HtmlMenuGroup
component-family | org.richfaces.DropDownMenu
renderer-type | org.richfaces.MenuGroupRenderer
tag-class | org.richfaces.taglib.MenuGroupTag

Table 6.82. Facets

Facet | Description
--- | ---
icon | Redefines the icon for the enabled item state. Related attribute is "icon"
iconFolder | Redefines the folder icon for the enabled item state. Related attribute is "iconFolder"

Table 6.83. Classes names that define an appearance of group elements

Class name | Description
--- | ---
rich-menu-group | Defines styles for a wrapper <div> element for a group
rich-menu-item-label | Defines styles for a label of an item
rich-menu-item-icon | Defines styles for the left icon of an item
rich-menu-item-folder | Defines styles for the right icon of an item

Table 6.84. Classes names that define different states

Class name | Description
--- | ---
rich-menu-item-label-disabled | Defines styles for a label of a disabled item
rich-menu-item-icon-disabled | Defines styles for the left icon of a disabled item
rich-menu-item-folder-disabled | Defines styles for the right icon of a disabled item
rich-menu-group-hover | Defines styles for a wrapper <div> element of a hover group
rich-menu-item-icon-enabled | Defines styles for the left icon of an enabled item
rich-menu-item-icon-selected | Defines styles for the left icon of a selected item

You can find all necessary information about style classes redefinition in Definition of Custom Style Classes section.

#### 6.8.3.5. Relevant Resources Links

On the component LiveDemo page you can see the example of <rich:menuGroup> usage and sources for the given example.

- Prev6.8.2. < rich:dropDownMenu > ...
- Top of page
- Front page
- Next6.8.4. < rich:menuItem > ...