3 Replies Latest reply on Dec 4, 2008 6:17 AM by leelavathic leelavathic

    Expression for using the f:param values in rendered attribut

    leelavathic leelavathic Novice

      I have a rich:tree. I want to conditionally display a context menu on right click of the treeNode.

      <rich:tree id="treeData" label="Tree Data" switchType="ajax" adviseNodeOpened="#{treeMgdBean.adviseNodeOpened}"
      adviseNodeSelected="#{treeMgdBean.adviseNodeSelected}" value="#{treeMgdBean.rootNode}" var="item"
      nodeFace="#{item.type}" ajaxSingle="false" ajaxSubmitSelection="true" treeNodeVar="nodeVar"
      ajaxKeys="#{treeMgdBean.ajaxKeys}">
      
      <rich:treeNode type="Page" nodeSelectListener="#{treeMgdBean.retrievePage}"
      changeExpandListener="#{treeMgdBean.processTreeExpansion}"
      icon="/../common/images/page.gif" iconLeaf="/../common/images/page.gif">
      
       <h:outputText value="#{item.name}" styleClass="treeText" />
       <rich:componentControl event="oncontextmenu" for="treeMenu" operation="show">
       <f:param value="#{nodeVar.data.id}" name="nodeId"/>
       <f:param value="#{nodeVar.data.nodeSubType}" name="nodeSubType"/>
       </rich:componentControl>
      </rich:treeNode>
      </rich:tree>
      <rich:contextMenu attached="false" id="treeMenu" submitMode="ajax">
       <rich:menuItem ajaxSingle="true" id="sportsmenu" reRender="sportsmenu"
       limitToList="true" onclick="mapSports('{nodeId}')" rendered="#{nodeSubType == 'SPORTS'}">
       Map to Sports
       </rich:menuItem>
      </rich:contextMenu>
      

      I want to display the context menu if nodeSubType is Sports. I tried giving rendered="#{nodeSubType == 'SPORTS'}" , but the context menu is not displayed.

      Can anyone tell me what is the correct syntax.