Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.8.4.  < rich:menuItem > available since 3.0.0

The <rich:menuItem> component is used for the definition of a single item inside a pop-up list.

This component can be used not only within <rich:dropDownMenu> and <rich:contextMenu> , but also it can used as a standalone component. For example, you can use it as nested component of the <rich:toolBar> .


The "value" attribute defines the text representation for an item element.

There are two icon-related attributes. The "icon" attribute defines an icon. The "iconDisabled" attribute defines an icon for a disabled item. 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 content is shown as an icon. It 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 <rich:menuItem> "submitMode" attribute can be set to three possible parameters:

Regular form submission request is used.

Ajax submission is used for switching.

The "action" and "actionListener" item's attributes are ignored. Menu items don' fire any submits themselves. The behavior is fully defined by the components nested into items.

For example, you can put any content into an item, but, in this case, you should set the "submitMode" attribute as "none" .

Here is an example:


...
<rich:dropDownMenu>
        ...
       <rich:menuItem submitMode="none">
                <h:outputLink value="www.jboss.org"/>
        </rich:menuItem>
        ...
<rich:dropDownMenu>
...

You can use the "disabled" attribute to set the item state.

Here is an example:


...
<rich:dropDownMenu>
        <rich:menuItem value="Disable" disabled="true"/>
<rich:dropDownMenu>
...

Information about the "process" attribute usage you can find RichFaces Developer Guide section about "process" attribute .

Table of <rich:menuItem> attributes.





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

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