3 Replies Latest reply on Mar 25, 2010 4:42 AM by E Geylani

    rich:tree node selection problem..

    E Geylani Novice

      Hey everyone, i have a problem with rich tree component.

       

      I am dynamicaly creating a treeNode and adding to selected node. everything looks and works fine until i select some older nodes, i get an illegal state exception (full trace below..)

       

      thx in advance..

       

      here is my xhtml tree :

               <rich:tree id="treeId" switchType="client"
                      nodeFace="#{item.type}"
                      nodeSelectListener="#{viewBean.processParentSelection}"
                      ajaxSubmitSelection="true"
                      value="#{viewBean.dummyTreeNode}" var="item">
                      <rich:treeNode type="TYPE1"
                          icon="/images/puzzle1.png"  reRender="treeId"
                          iconLeaf="/images/puzzle1.png">
                          <h:outputText value="#{item.info}" />                   
                      </rich:treeNode>
                  </rich:tree>


      here is my java code to create and insert new nodes..

      void addNode(ViewBean viewBean) {

              TreeNode<TreeNodeData> parentNode = viewBean.getSelectedTreeNode();
              TreeNodeData parentTreeNodeData = parentNode.getData();    // custom node data object.       
              Set<TreeNodeData> set = parentTreeNodeData.getSubSet();               
              TreeNodeData childTreeNodeData = new TreeNodeData();               
              TreeNode<TreeNodeData> cihldNode = new TreeNodeImpl<TreeNodeData>();         
              childTreeNodeData.setSomeValue("..");                       
              set.add(childTreeNodeData);
              cihldNode.setData(childTreeNodeData);
              cihldNode.setParent(parentNode);       
              parentNode.addChild(childTreeNodeData, cihldNode);

      }

       

       

      Full stacktrace:

      java.lang.IllegalStateException: No tree element available or row key not set!
          at org.richfaces.model.ClassicTreeDataModel.getTreeNode(ClassicTreeDataModel.java:53)
          at org.richfaces.component.UITree.getTreeNode(UITree.java:187)
          at tr.com.company.ttbp.view.beans.prim.engine.TarifeViewBean.processSelection(TarifeViewBean.java:127)
          at org.richfaces.event.NodeSelectedEvent.processListener(NodeSelectedEvent.java:63)
          at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:489)
          at javax.faces.component.UIData.broadcast(UIData.java:482)
          at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1303)
          at org.richfaces.component.UITree.broadcast(UITree.java:544)
          at org.ajax4jsf.component.UIDataAdaptor.broadcast(UIDataAdaptor.java:1316)
          at org.richfaces.component.UITree.broadcast(UITree.java:544)
          at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:316)
          at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:291)
          at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:248)
          at org.ajax4jsf.component.AjaxViewRoot.processUpdates(AjaxViewRoot.java:427)
          at org.apache.myfaces.lifecycle.UpdateModelValuesExecutor.execute(UpdateModelValuesExecutor.java:33)
          at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
          at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:148)
          at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:100)
          at tr.com.company.common.middleware.web.servlets.ErrorHandlingFacesServlet.service(ErrorHandlingFacesServlet.java:53)
          at tr.com.company.common.middleware.web.servlets.ServletToBeanProxy.service(ServletToBeanProxy.java:46)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
          at tr.com.company.ttbp.web.filters.ExtensionsExceptFileuploadFilter.doFilter(ExtensionsExceptFileuploadFilter.java:30)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:147)
          at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:256)
          at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:362)
          at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
          at tr.com.company.common.middleware.web.filters.CurrentUserFilterInvocationDefinitionsSessionIntegrationFilter.doFilter(CurrentUserFilterInvocationDefinitionsSessionIntegrationFilter.java:52)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:265)
          at org.acegisecurity.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:107)
          at tr.com.company.ttbp.security.auth.RaporFlowIdAwareFilterSecurityInterceptor.doFilter(RaporFlowIdAwareFilterSecurityInterceptor.java:19)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.ui.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:124)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:81)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.ui.logout.LogoutFilter.doFilter(LogoutFilter.java:110)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at tr.com.company.common.middleware.web.filters.CurrentFlowIdSessionIntegrationFilter.doFilter(CurrentFlowIdSessionIntegrationFilter.java:57)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at tr.com.company.common.middleware.web.filters.ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:97)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at tr.com.company.common.middleware.web.filters.BypassAcegiAuthenticationFilter.doFilter(BypassAcegiAuthenticationFilter.java:98)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at tr.com.company.common.middleware.web.filters.AppUrlPreAppendingResponseWrapperFilter.doFilter(AppUrlPreAppendingResponseWrapperFilter.java:32)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
          at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
          at org.acegisecurity.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:275)
          at org.acegisecurity.util.FilterChainProxy.doFilter(FilterChainProxy.java:149)
          at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at tr.com.company.ttbp.utils.web.filter.HttpCacheSetterFilter.doFilter(HttpCacheSetterFilter.java:29)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at tr.com.company.common.middleware.web.filters.Log4JNDCFilter.doFilter(Log4JNDCFilter.java:55)
          at org.acegisecurity.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:98)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Unknown Source)