2 Replies Latest reply on May 12, 2008 11:50 AM by Bjoern Eickvonder

    Help needed : How to get the treeNode handle on selecting a

    leelavathic leelavathic Novice

      Hi

      I have created a rich faces as below.

      <rich:panel styleClass="class1">
      <a4j:form id="Form1">
      <rich:tree
      nodeSelectListener="#{treeBean.processSelection}"
      ajaxSubmitSelection="true"
      switchType="ajax"
      changeExpandListener="#{treeBean.processExpansion}"
      adviseNodeOpened="#{treeBean.adviseNodeOpened}"
      id="myTree"
      ajaxSingle="true"
      adviseNodeSelected="#{treeBean.adviseNodeSelected}"
      value="#{treeBean.treeNode}" var="item" nodeFace="#{item.type}">

      <rich:treeNode
      type="node"
      iconLeaf="norm.gif"
      icon="norm1.gif" >
      <h:outputText value="#{item.name}" />
      </rich:treeNode>
      </rich:tree>
      </a4j:form>
      </rich:panel>

      But when a node is selected by click operation, I am getting the handle of the tree component(UITree) in my backing bean method (processSelection) and not the .
      Can any one tell me how can I get the handle of the treeNode on selection?

      Regards,
      Abhilash

        • 1. Re: Help needed : How to get the treeNode handle on selectin
          leelavathic leelavathic Novice

           

          "leelavathic" wrote:
          Hi

          I have created a rich faces as below.

          <rich:panel styleClass="class1">
          <a4j:form id="Form1">
          <rich:tree
          nodeSelectListener="#{treeBean.processSelection}"
          ajaxSubmitSelection="true"
          switchType="ajax"
          changeExpandListener="#{treeBean.processExpansion}"
          adviseNodeOpened="#{treeBean.adviseNodeOpened}"
          id="myTree"
          ajaxSingle="true"
          adviseNodeSelected="#{treeBean.adviseNodeSelected}"
          value="#{treeBean.treeNode}" var="item" nodeFace="#{item.type}">

          <rich:treeNode
          type="node"
          iconLeaf="norm.gif"
          icon="norm1.gif" >
          <h:outputText value="#{item.name}" />
          </rich:treeNode>
          </rich:tree>
          </a4j:form>
          </rich:panel>

          But when a node is selected by click operation, I am getting the handle of the tree component(UITree) in my backing bean method (processSelection) and not the .
          Can any one tell me how can I get the handle of the treeNode on selection?

          Thanks in advance



          • 2. Re: Help needed : How to get the treeNode handle on selectin
            Bjoern Eickvonder Newbie

            UITree tree = (UITree) event.getComponent();
            TreeNode node = tree.getTreeNode();

            should work.