1 Reply Latest reply on Jul 10, 2016 4:37 PM by jsf learner

    How to access data values from root  to child node (whole selected path) of rich:tree

    vj j Newbie

      hello,

       

      I am working with richfaces 4.2.1 final.

      I am using rich:tree with nested <rich:treeModelAdaptor>. As, var attribute is common for all nested levels, Can you please suggest me how to access the corresponding parent node value when a child node got selected. I need to retrieve the all node objects of the selected path from root to the selected child.

       

      My code is pasted below. Please suggest me.

       

       

      <rich:tree binding="#{aa.tree}" id="searchTree1" var="node" toggleType="client"

                                                          selectionType="ajax" selectionChangeListener="#{aa.onSelection}">

                                                          <rich:treeModelAdaptor   nodes="#{adverseEvent.productList}"

                                                               leaf="false" >

                                                              <rich:treeNode id="#{aa.counter()}"  binding="#{aa.node}" expanded="#{true}">

                                         

      #{node.name} 

       

       

                                                   </rich:treeNode>

                                                  

                                                              <rich:treeModelAdaptor nodes="#{node.productExposureList}"

                                                                  leaf="false">

                                                                  <rich:treeNode expanded="#{true}">

                                         #{node.name} 

                                         <a4j:commandButton id="add" value="edit"  action="#{aa.methoda(node1)}" />

                                                </rich:treeNode>

                                                                  <rich:treeModelAdaptor

                                                                      nodes="#{node.productExposureDoseList}" leaf="false">

                                                                      <rich:treeNode  value="#{aa.dose1}" expanded="#{true}">

                        #{node.name}   hh    #{node1.name}                       <a4j:commandButton id="add" value="edit"  action="#{aa.methoda(node1.name)}" />

                                      </rich:treeNode>

                                                                      <rich:treeModelAdaptor

                                                                          nodes="#{node.intervalDetailsList}" leaf="true">

                                                                          <rich:treeNode  value="#{aa.interval1}" expanded="#{true}">

      intervallllllllllll     #{node.intervalUnits}

      </rich:treeNode>

                                                                      </rich:treeModelAdaptor>

                                                                  </rich:treeModelAdaptor>

                                                              </rich:treeModelAdaptor>

       

                                                          </rich:treeModelAdaptor>

                                                      </rich:tree>