3 Replies Latest reply on Jan 4, 2012 2:34 AM by Saurabh Tyagi

    Rich:tree node selection by java script

    Saurabh Tyagi Newbie

      Hi all,

       

      Please tell me how do i able to select/deselect tree node checkboxes by java script. If Parent node is selected/deselected than it should also select/deselect child nodes. i dont want to go every time at server side.

       

      my rich:tree code is as follows :

       

      <rich:tree toggleOnClick="false" id="groupTree" reRender="groupTree" ajaxSubmitSelection="true"  switchType="client"           value="#{treeGenerator.groupTree}"  var="item"          oncontextmenu="true" ajaxKeys="#{null}">

                     <rich:treeNode  iconLeaf="/sparkImages/faces/#{item.gender}.png" icon="/sparkImages/faces/user-group-icon.png">

                                    <h:selectBooleanCheckbox value="#{item.checked}"></h:selectBooleanCheckbox>

                                    <h:outputText style="color:#{item.rowColor}" value="#{item.name}" />

                     </rich:treeNode>

      </rich:tree> 

       

      Thanks & Regards:

       

      -Saurabh