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.10.6.  < rich:panelMenu > available since 3.1.0

Table 6.235. rich : panelMenu attributes

Attribute Name Description
binding JSF: The attribute takes a value-binding expression for a component property of a backing bean
converter JSF: Id of Converter to be used or reference to a Converter
converterMessageA ValueExpression enabled attribute that, if present, will be used as the text of the converter message, replacing any message that comes from the converter
disabledHTML: If true sets state of the item to disabled state. Default value is "false".
disabledGroupClassAssigns one or more space-separated CSS class names to the component disabled groups
disabledGroupStyleCSS style rules to be applied to the component disabled groups
disabledItemClassAssigns one or more space-separated CSS class names to the component disabled items
disabledItemStyleCSS style rules to be applied to the component disabled items
eventDefines the event on the representation element that triggers the submenu's expand/collapse. Default value is "onclick".
expandModeSet the submission mode for all panel menu groups after expand/collapse except ones where this attribute redefined. Possible values are "ajax", "server", "none". Default value is "none".
expandSingleWhether only one panel menu node on top level can be opened at a time. If the value of this attribute is true, the previously opened node on the top level is closed. If the value is false, the node is left opened. Default value is "false".
groupClassAssigns one or more space-separated CSS class names to any component group except top groups
groupStyleCSS style rules to be applied to any component group except top groups
hoveredGroupClassAssigns one or more space-separated CSS class names to the component hovered group
hoveredGroupStyleCSS style rules to be applied to the component hovered group
hoveredItemClassAssigns one or more space-separated CSS class names to the component hovered item
hoveredItemStyleCSS style rules to be applied to the component hovered item
iconCollapsedGroupPath to the icon to be displayed for the collapsed Group state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconCollapsedTopGroupPath to the icon to be displayed for the collapsed top group state.\ You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconDisabledGroupPath to the icon to be displayed for the disabled group state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconDisabledItemPath to the icon to be displayed for the disabled item state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconExpandedGroupPath to the icon to be displayed for the expanded Group state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconExpandedTopGroupPath to the icon to be displayed for the expanded top group state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconGroupPositionPosition of the icon for the group icon. Possible values are "left","right","none". Default value is "left".
iconGroupTopPositionPosition of the icon for the top group icon. Possible values are "left","right","none". Default value is "left".
iconItemPath to the icon to be displayed for the enabled item state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconItemPositionPosition of the icon for the item icon. Possible values are "left","right","none". Default value is "left".
iconItemTopPositionPosition of the icon for the top item icon. Possible values are "left","right","none". Default value is "left".
iconTopDisabledItemPath to the icon to be displayed for the disabled top item state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconTopDisableGroupPath to the icon to be displayed for the disabled top Group state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
iconTopItemPath to the icon to be displayed for the enabled top item state. You can also use predefined icons, setting the attribute to one of these possible values: "triangle", "triangleUp", "triangleDown", "disc", "chevron", "chevronUp", "chevronDown", "grid". Default value is "grid".
id JSF: Every component may have a unique id that is automatically created if omitted
immediateA flag indicating that this component value must be converted and validated immediately (that is, during Apply Request Values phase), rather than waiting until a Process Validations phase
itemClassAssigns one or more space-separated CSS class names to any component item except top items
itemStyleCSS style rules to be applied to the component item except top items
labelA localized user presentable name for this component.
modeSet the submission mode for all panel menu items on the panel menu except ones where this attribute redefined. Possible values are "ajax", "server", "server". Default value is "server".
onclick DHTML: The client-side script method to be called when the component is clicked
ondblclick DHTML: HTML: a script expression; a pointer button is double-clicked
ongroupcollapseThe client-side script method to be called when some group is closed
ongroupexpandThe client-side script method to be called when some group is activated
onitemhoverThe client-side script method to be called when a panel menu item is hovered
onkeydown DHTML: The client-side script method to be called when a key is pressed down over the element
onkeypress DHTML: The client-side script method to be called when a key is pressed over the element and released
onkeyup DHTML: The client-side script method to be called when a key is released
onmousedown DHTML: The client-side script method to be called when a mouse button is pressed down over the element
onmousemove DHTML: The client-side script method to be called when a pointer is moved within the component
onmouseout DHTML: The client-side script method to be called when a pointer is moved away from the component
onmouseover DHTML: The client-side script method to be called when a pointer is moved onto the component
onmouseup DHTML: The client-side script method to be called when a mouse button is released
rendered JSF: If "false", this component is not rendered
required JSF: If "true", this component is checked for non-empty input
requiredMessageA ValueExpression enabled attribute which defines text of validation message to show, if a required field is missing
selectedChildcontain the name or the clientId of any of the item or group, the child defined in this attribute should be highlighted on PanelMenu rendering
styleHTML: CSS style rules to be applied to the component
styleClass JSF: Assigns one or more space-separated CSS class names to the component. Corresponds to the HTML "class" attribute.
topGroupClassAssigns one or more space-separated CSS class names to the component top groups
topGroupStyleCSS style rules to be applied to the component top groups
topItemClassAssigns one or more space-separated CSS class names to the component top items
topItemStyleCSS style rules to be applied to the component top items
validator JSF: MethodBinding pointing at a method that is called during Process Validations phase of the request processing lifecycle, to validate the current value of this component
validatorMessageA ValueExpression enabled attribute that, if present, will be used as the text of the validator message, replacing any message that comes from the validator
value JSF: The current value of this component
valueChangeListener JSF: Listener for value changes
widthHTML: Set minimal width for the menu. Default value is "100%".


All attributes are not required.

Use "event" attribute to define an event for appearance of collapsing/expanding sublevels. Default value is "onclick". An example could be seen below.

Example:


...
<rich:panelMenu event="onmouseover">
        <!--Nested panelMenu components-->
</rich:panelMenu>
...

Switching mode could be chosen with the "mode" attribute for all panelMenu items except ones where this attribute was redefined. By default all items send traditional request.

The "expandMode" attribute defines the submission modes for all collapsing/expanding panelMenu groups except ones where this attribute was redefined.

The "mode" and "expandMode" attributes could be used with three possible parameters. The "mode" attribute defines parameters for all included <rich:panelMenuItem> elements.

The common submission of the form is performed and a page is completely refreshed.

Example:


...
<rich:panelMenu mode="server">
        <rich:panelMenuGroup label="test Group" action="#{bean.action}"> 
                <rich:panelMenuItem label="test" action="#{capitalsBean.action}"> 
                    <f:param value="test value" name="test"/> 
                </rich:panelMenuItem> 
        </rich:panelMenuGroup>
</rich:panelMenu>
...

An Ajax form submission is performed, and additionally specified elements in the "reRender" attribute are reRendered.

Example:


...
<rich:panelMenu mode="ajax">
        <rich:panelMenuGroup label="test Group" action="#{bean.action}"> 
                <rich:panelMenuItem label="test" reRender="test" action="#{capitalsBean.action}"> 
                        <f:param value="test value" name="test"/> 
                </rich:panelMenuItem> 
        </rich:panelMenuGroup>
</rich:panelMenu>
...

"Action" and "ActionListener" item's attributes are ignored. Items don't fire any submits itself. Behavior is fully defined by the components nested into items.

Example:


...
<rich:panelMenu event="onclick" submitMode="none">
        <rich:panelMenuItem label="Link to external page">
                <h:outputLink ... >
        <rich:panelMenuItem>
</rich:panelMenu>
...

The "expandSingle" attribute is defined for expanding more than one submenu on the same level. The default value is "false" . If it's true the previously opened group on the top level closes before opening another one. See the picture below.


The "selectedChild" attribute is used for defining the name of the selected group or item. An example for group is placed below:

Here is an example:

Example:


...
<rich:panelMenu selectedChild="thisChild">
        <rich:panelMenuGroup label="Group1" name="thisChild">
                <!--Nested panelMenu components-->
        </rich:panelMenuGroup>
</rich:panelMenu>
...

The "label" attribute is a generic attribute. The "label" attribute provides an association between a component, and the message that the component (indirectly) produced. This attribute defines the parameters of localized error and informational messages that occur as a result of conversion, validation, or other application actions during the request processing lifecycle. With the help of this attribute you can replace the last parameter substitution token shown in the messages. For example, {1} for "DoubleRangeValidator.MAXIMUM", {2} for "ShortConverter.SHORT".

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