2 Replies Latest reply: Mar 28, 2013 7:21 PM by 952174 RSS

    ADF Tree - Check/Uncheck performance issue

    952174
      Hi,

      Iam using JDev 11.1.1.5.0.

      I am able to display the required Tree structure and also able to check/uncheck functionality using below logic.

      I am facing a performance issue. As our tree having up to 5 levels and each level having more than 100 children.

      If I try to check top level node, then all the sub-levels should be checked. The same functionality for uncheck also.

      Is it possible to improve the performance? If so, Can you suggest any clue to improve the performance?


      public void checkBoxValueChangeHandler(RichTree navTree,ValueChangeEvent valueChangeEvent) {
      if ((Boolean)(valueChangeEvent.getOldValue()) != null) {
      Boolean check = (Boolean)valueChangeEvent.getNewValue();
      CollectionModel model = (CollectionModel)navTree.getValue();
      JUCtrlHierBinding treeBinding =
      (JUCtrlHierBinding)model.getWrappedData();
      JUCtrlHierNodeBinding currentSelectedNode =
      (JUCtrlHierNodeBinding)navTree.getRowData();
      if(check == true){
      currentSelectedNode.setAttribute("checkboxConfirmedStatus","Y");
      checkTree(currentSelectedNode.getChildren());
      } else {
      currentSelectedNode.setAttribute("checkboxConfirmedStatus","N");
      uncheckTree(currentSelectedNode.getChildren());
      }
      refreshSelectedRows(navTree);
      }
      }
      private void checkTree(List<JUCtrlHierNodeBinding> children) {
      if ( children != null ) {
      for (JUCtrlHierNodeBinding _node : children) {
      _node.setAttribute("checkboxConfirmedStatus", "Y");
      List<JUCtrlHierNodeBinding> innerChildren = null;
      innerChildren = _node.getChildren();
      checkTree(innerChildren);
      } //End of for loop
      }
      }

      Thanks,
      Samba