You can use the value attribute of the
contextual menu element to bind a static menu (running the code
of the factory only once).
<... contextualMenu ... value="#{chartBean.menu}" />
In addition, you can use menu, menuItem,
or menuSeparator tag components directly in the page:
<jvf:contextualMenu itemStyleClass="menuItem"
itemHighlightedStyleClass="menuItemHighlighted"
itemDisabledStyleClass="menuItemDisabled">
<jv:menu>
<jv:menuItem label="menuItem 1" onclick="alert('menuItem 1')" />
<jv:menuItem label="menuItem 2" onclick="alert('menuItem 2')" />
<jv:menuItem label="menuItem 3" onclick="alert('menuItem 3')" />
<jv:menuSeparator />
<jv:menu label="subMenu">
<jv:menuItem label="subMenu Item 1"
onclick="alert('subMenu Item 1')" />
<jv:menuItem label="subMenu Item 2"
onclick="alert('subMenu Item 2')" />
</jv:menu>
</jv:menu>
</jvf:contextualMenu>
See also Guide to using JViews JSF
components with ICEfaces.