Context menu for multiple targets
srikanthreddy123 Feb 28, 2013 9:36 AMHi,
I have a requirment where in I have to render a context menu on the header of an accordion item and I need to a dynamic accordion.
Can you please help me out in associating context menu to it. I tried to used targetSelector by asociated it to a style class which din't worked out.
<rich:accordion id="accCTN" switchType="client" activeItem="#{ctnMgmtController.activeTab}">
<c:forEach id="ctnRepeatL"
items="#{ctnMgmtController.ctnGroups}" var="groupName">
<rich:accordionItem switchType="client"
name="#{groupName}" headerStyle="height: 10px" >
<f:facet name="header">
<h:outputText value="CTN Groups" id="test112" styleClass="menuable"></h:outputText>
</f:facet>
</rich:accordionItem>
</c:forEach>
</rich:accordion>
<rich:contextMenu id="ctnGrpCtxmenu" target="test112"
disableDefaultMenu="true">
<rich:menuItem label="Manage Permissions"
onclick="enlarge(#{rich:element('pic')});"
id="manPerCtxMnuItm" />
<rich:menuItem label="Add CTN"
onclick="decrease(#{rich:element('pic')});"
id="addCtnCtxMnuItm" />
<rich:menuItem label="Update group name"
onclick="decrease(#{rich:element('pic')});"
id="updateGrpCtxMnuItm" />
<rich:menuItem label="Delete Group"
onclick="decrease(#{rich:element('pic')});"
id="delGrpCtxMnuItm" />
</rich:contextMenu>
<rich:contextMenu id="ctnGrpCtxmenu" targetSelector=".menuable"
disableDefaultMenu="true">
<rich:menuItem label="Manage Permissions"
onclick="enlarge(#{rich:element('pic')});"
id="manPerCtxMnuItm" />
<rich:menuItem label="Add CTN"
onclick="decrease(#{rich:element('pic')});"
id="addCtnCtxMnuItm" />
<rich:menuItem label="Update group name"
onclick="decrease(#{rich:element('pic')});"
id="updateGrpCtxMnuItm" />
<rich:menuItem label="Delete Group"
onclick="decrease(#{rich:element('pic')});"
id="delGrpCtxMnuItm" />
</rich:contextMenu>