2 Replies Latest reply on Dec 16, 2008 10:41 PM by marcus sim

    Tree component nodes clickable

    marcus sim Newbie

      Hi,

      I am using the tree component. Is there any way to make the nodes in the tree clickable and execute action. For example as below

       <rich:tree switchType="client" style="width:100px" value="#{listChatUser.userList}" var="item" >
       <rich:treeNode type="user" iconLeaf="/images/disc.gif" icon="#{facesContext.externalContext.requestContextPath}/images/disc.gif">
       <h:commandLink action="#{listChatUser.removeSelectedUsers}" value="#{item}"/>
       </rich:treeNode>
       </rich:tree>
      


      I can't seem to make the nodes to click using the above.
      Thanks.



        • 1. Re: Tree component nodes clickable
          Ilya Shaikovsky Master

          sinmple way is ajaxSubmitSelection=true and nodeSelectListener usage. In this case - command components not needed to be used inside. node will be clickable itself.

          Check tree drag and drop example in rich faces demo(try Beta 3). There are also actions execution on node click shown.

          • 2. Re: Tree component nodes clickable
            marcus sim Newbie

            Hi,

            Thanks for the reply. I am planning to perform a pop up box on clicking a tree node. Something like below

            <rich:tree switchType="client" style="width:100px" value="#{listChatUser.userList}" var="item" >
            <rich:treeNode type="user" iconLeaf="/images/disc.gif" icon="#{facesContext.externalContext.requestContextPath}/images/disc.gif">
            <a4j:commandLink action="#{listChatUser.removeSelectedUsers}" value="#{item}" onclick="if(confirm('Confirm delete?') == false ) return false;"/>
            </rich:treeNode>
            </rich:tree>
            


            Just want to know whether the above is possible. Cause I can't get this to work.