2 Replies Latest reply on Jan 23, 2013 12:19 AM by Rick Lu

    Event when clicking a tree node - RF4 tree

    Rick Lu Newbie

      I am using RF4.

      TreeSelectionChangeEvent won't be invoked if clicking on a already seleted node.


      Is there a event will be invoked all the time.

      Something like "onClick", I tried it but with no luck. 


      I am also not sure about how to get the selected node from ActionEvent.





      <h:form id="formTree">



                                    <rich:tree id="tree" value="#{treeTabBean.root}" var="node"

                                              nodeType="#{node.type}" toggleType="client"



                                              selectionType="ajax" render="showSelected, tabsWrapper">



                                              <rich:treeNode type="leaf"           onClick="selectNode();">

                                                        <h:outputText value="#{node}" />




                                              <rich:treeNode type="branch">

                                                        <h:outputText value="#{node}" />





                                    <a4j:jsFunction id="selectode" render="tabsWrapper"

                                              name="selectNode" actionListener="#{treeTabBean.clickChanged}">




                                    <a4j:outputPanel id="showSelected" layout="block">

                                              <h:outputText value="#{treeTabBean.selected}" rendered="#{true}" />






      public void clickChanged(ActionEvent event) {


                          log.info("-clickChanged:: ******** start");

                          UITree tree = (UITree) event.getComponent();

                          selected = (TreeElement<String>) tree.getRowData();