0 Replies Latest reply on Sep 30, 2011 8:09 AM by Charlin Joe

    Richfaces:Tree Performance problem

    Charlin Joe Newbie

      I am facing performance problem for the following source code. Can anyone give suggestion to improve


      Here this tree will have many folders and and under each folder there are many Files. There is possiblity of nested folders too.

      When there are few entries under a folder then the expansion is working without any problem. When there are many entries under a folder (for say 5000) then the expansion of folder is taking more time. Also I observed that when this big folder is expanded, and now when trying to open a folder with less entries also taking more time to expand.


      Here is my complete code (If you are not able to see my code clearly look into the attched files)


      XHTML code


      <html xmlns="http://www.w3.org/1999/xhtml"
            xmlns:rich="http://richfaces.org/rich" >

      <rich:tree nodeSelectListener="#{PageBean.processSelection}"
         ajaxSubmitSelection="true"  id="custo_tree"
         switchType="ajax" value="#{PageBean._treeNode}" var="item" componentState="#{PageBean._treeState}"
         ajaxKeys="#{null}" nodeFace="#{item._type}" 
         <rich:treeNode data="#{item._id}"
          icon="#{item._icon}" reRender="work_area"
           id="sclass" >
          <f:facet name="iconCollapsed">
                 <h:graphicImage value="/claflib/images/tree/plus1.gif"/>
          <f:facet name="iconExpanded">
                 <h:graphicImage value="/claflib/images/tree/minus.gif"/>
           <h:outputText value="#{item._value}" styleClass="#{item._styleClass}" />



      PageBean class


      public class PageBean {

      private TreeNode<MyTree> _treeNode = null;

      private DataComponentState _treeState = new TreeState();

      public void processSelection(NodeSelectedEvent event){

      public void processExpansion(NodeExpandedEvent event){




      MyTree Class

      public class MyTree{

      private String _id;
      private String _type;
      private String _icon;
      private String _value;
      private String _styleClass;