5 Replies Latest reply on Sep 25, 2008 8:21 PM by Anton Polyakov

    Problems using rich:tree with seam

    Anton Polyakov Newbie

      Hello all!


      I'm new to Seam as well as to Richfaces, but I already love this frameworks. However I'm now stuck with a problem and don't know where to start. Almost all my requests in Google now have all links marked as visited :) Please help!
      I want to draw a tree with checkboxes inside a Seam conversation, it might contain different nodes in different conversations (that's why SESSION is not working here).  Tree should contain the following structure: Company - User group - Users.
      I have followed the code found on http://jboss.com/index.html?module=bb&op=viewtopic&t=122601&postdays=0&postorder=asc&start=10
      So I have a page:


      
      <body>
      <a4j:form id="treeForm" ajaxSubmit="true">
           <h:panelGrid columns="1" id="allPanel">
                <rich:panel id="treePanel">
                     <rich:tree value="#{usersStructure.data}" var="item"
                          nodeFace="#{item.type}" style="width:300px"
                          selectedClass="selectedNode">
      
                          <rich:treeNode highlightedClass="treeLink"
                               type="usersCompanyTreeNode">
                               <h:outputText value="#{item.name}" />
                          </rich:treeNode>
                          <rich:treeNode highlightedClass="treeLink" type="userGroupsTreeNode">
                               <h:outputText value="#{item.name}" />
                               <h:selectBooleanCheckbox value="#{item.selected}" immediate="true">
                                    <a4j:support event="onclick"
                                         actionListener="#{CalendarEventEditor.processUsersSelection}"
                                         reRender="panelCurrentlySelected" />
                               </h:selectBooleanCheckbox>
                          </rich:treeNode>
                          <rich:treeNode highlightedClass="treeLink" type="usersTreeNode">
                               <h:outputText value="#{item.name}" />
                               <h:selectBooleanCheckbox value="#{item.selected}" immediate="true">
                                    <a4j:support event="onclick"
                                         actionListener="#{CalendarEventEditor.processUsersSelection}"
                                         reRender="currentlySelectedList" />
                               </h:selectBooleanCheckbox>
                          </rich:treeNode>
      
                     </rich:tree>
      
                     <h:panelGrid columns="1" id="panelCurrentlySelected">
                          <h:outputText value="Users, currently participating in this event:" />
                          <rich:dataList var="user"
                               value="#{editingOccurence.participantsList}"
                               id="currentlySelectedList">
                               <h:outputText value="#{user.name}" />
                               <h:outputText value="name" />
                          </rich:dataList>
                          <h:outputText value="No users selected" id="emptyUsersText" />
                          <h:messages />
                     </h:panelGrid>
                </rich:panel>
                <h:panelGrid columns="2">
                     <h:commandButton title="OK" value="OK"
                          action="#{CalendarEventEditor.saveEvent}" />
                     <h:commandButton title="Close" value="Close" />
                </h:panelGrid>
           </h:panelGrid>
      </a4j:form>
      


      I also have bean for fullfilling its data:


      
      @Name("CalendarEventEditor")
      @Stateless
      @Scope(ScopeType.CONVERSATION)
      public class CalendarEventEditorBean implements CalendarEventEditor {
      @Out(required = false)
           private UsersStructureTreeNode usersStructure;
      ...
      public void prepareParticipantsList() {
      usersStructure = new UsersStructureTreeNode();
      ...
      }
      }
      


      prepareParticipantsList is called each time before redirecting to tree page.
      Actual result is that tree is rendered but only with a root node, no other nodes are expanded while clicking on a tree. If I change tree switchType to client, everything works fine until I click on ajax-enabled checkbox (actually, on the second click). Then I receive:


      
      23:09:11,875 WARN  [lifecycle] executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@d2821b) threw exception
      javax.faces.FacesException: java.lang.ClassCastException: java.lang.String
           at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:457)
           at org.ajax4jsf.component.UIDataAdaptor.encodeAjaxChild(UIDataAdaptor.java:421)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:123)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxChildren(AjaxChildrenRenderer.java:86)
           at org.ajax4jsf.renderkit.AjaxChildrenRenderer.encodeAjaxComponent(AjaxChildrenRenderer.java:134)
           at org.ajax4jsf.renderkit.AjaxContainerRenderer.encodeAjax(AjaxContainerRenderer.java:122)
           at org.ajax4jsf.component.AjaxViewRoot.encodeAjax(AjaxViewRoot.java:553)
           at org.ajax4jsf.context.AjaxContextImpl.renderAjaxRegion(AjaxContextImpl.java:286)
           at org.ajax4jsf.context.AjaxContextImpl$2.invoke(AjaxContextImpl.java:201)
           at org.ajax4jsf.context.JsfOneOneInvoker.invokeOnComponent(JsfOneOneInvoker.java:78)
           at org.ajax4jsf.context.AjaxContextImpl.invokeOnComponent(AjaxContextImpl.java:157)
           at org.ajax4jsf.context.AjaxContextImpl.renderSubmittedAjaxRegion(AjaxContextImpl.java:215)
           at org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:239)
           at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:106)
           at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)
           at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)
           at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
           at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
           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:230)
           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
           at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
           at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
           at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
           at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
           at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.ClassCastException: java.lang.String
           at org.richfaces.model.StackingTreeModel.doSetupKey(StackingTreeModel.java:129)
           at org.richfaces.model.StackingTreeModel.setupKey(StackingTreeModel.java:167)
           at org.richfaces.model.StackingTreeModel.setRowKey(StackingTreeModel.java:460)
           at org.ajax4jsf.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:339)
           at org.richfaces.renderkit.TreeRendererBase.encodeAjaxChildren(TreeRendererBase.java:424)
           ... 41 more
      


      Please help! This is going to make me mad!

        • 1. Re: Problems using rich:tree with seam
          Anton Polyakov Newbie

          Also, richfaces debug log shows the following during ajax request:


          debug[23:34:19,761]: Have Event [object Object] with properties: target: [object HTMLImageElement], srcElement: undefined, type: click
          debug[23:34:19,761]: NEW AJAX REQUEST !!! with form :treeForm
          debug[23:34:19,762]: Append hidden control treeForm:j_id2:input with value [] and value attribute []
          debug[23:34:19,763]: Append hidden control treeForm with value [treeForm] and value attribute [treeForm]
          debug[23:34:19,764]: Append hidden control autoScroll with value [] and value attribute []
          debug[23:34:19,764]: Append hidden control javax.faces.ViewState with value [_id4] and value attribute [_id4]
          debug[23:34:19,765]: parameter treeForm:j_id2:106:j_id3AjaxExpanded with value true
          debug[23:34:19,765]: parameter treeForm:j_id2:106:j_id3NodeExpanded with value true
          debug[23:34:19,766]: Start XmlHttpRequest
          debug[23:34:19,768]: Reqest state : 1
          debug[23:34:19,769]: QueryString: AJAXREQUEST=_viewRoot&treeForm%3Aj_id2%3Ainput=&treeForm=treeForm&autoScroll=&javax.faces.ViewState=_id4&treeForm%3Aj_id2%3A106%3Aj_id3AjaxExpanded=true&treeForm%3Aj_id2%3A106%3Aj_id3NodeExpanded=true&
          debug[23:34:19,770]: Reqest state : 1
          debug[23:34:19,924]: Reqest state : 2
          debug[23:34:19,924]: Reqest state : 3
          debug[23:34:19,924]: Reqest state : 3
          debug[23:34:19,924]: Reqest state : 4
          debug[23:34:19,925]: Reqest end with state 4
          debug[23:34:19,925]: Response with content-type: text/html;charset=UTF-8
          debug[23:34:19,925]: Full response content: <div xmlns:rich="http://richfaces.ajax4jsf.org/rich"><script src="/polyus/**/a4j_3_1_6.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/json/json-mini.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg.ajax4jsf.javascript.DnDScript" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-common.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js" type="text/javascript"></script><link href="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/css/dragIndicator.xcss/DATB/eAFjlbr0AAAC6gHS" type="text/css" rel="stylesheet" /><table border="0" cellpadding="0" cellspacing="0" class="dr-tree-full-width rich-tree-node" id="treeForm:j_id2:106:j_id3"><tbody><tr id="treeForm:j_id2:106:j_id3:mainRow" onclick=" "><td class="dr-tree-h-ic rich-tree-node-handleicon dr-tree-h-ic-line-node" style="background-image:expression(this.parentNode.parentNode.parentNode.nextSibling.nextSibling ? 'url(/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeLineNodeImage/DATB/eAH7....72fXGBgYACWpBbU_)' : 'url(/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeLineLastImage/DATB/eAH7....72fXGBgYACWpBbU_)')"><div><a href="#" id="treeForm:j_id2:106:j_id3:handle" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:j_id3AjaxExpanded':true,'treeForm:j_id2:106:j_id3NodeExpanded':'false'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} ); return false;"><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-collapsed" id="treeForm:j_id2:106:j_id3:handle:img:collapsed" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreePlusImage/DATB/eAH7....72fXGBgYACWpBbU_" style="display: none;" /><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" id="treeForm:j_id2:106:j_id3:handle:img:expanded" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeMinusImage/DATB/eAH7....72fXGBgYACWpBbU_" /></a></div></td><td class="dr-tree-h-ic rich-tree-node-icon dr-tree-h-ic-line-exp" id="treeForm:j_id2:106:j_id3:icon" rich:draggableoptions="{'parameters':{'dragSourceId':'treeForm:j_id2:106:j_id3','treeForm:j_id2:106:j_id3':'treeForm:j_id2:106:j_id3'} } " rich:dropzoneoptions="{} "><img class="dr-tree-h-ic-img-md dr-tree-h-ic-img" src="/polyus/**/a4j_3_1_6.GAimages/iconFolder.gif" /></td><td class="dr-tree-h-text rich-tree-node-text " id="treeForm:j_id2:106:j_id3:text" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted treeLink" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected selectedNode">MobiOffice</td></tr></tbody></table><div id="treeForm:j_id2:106:j_id3:childs" style="background-image:expression(this.nextSibling ? '' : 'none')" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-children rich-tree-node-cildren dr-tree-h-ic-line"><p class="dr-tree-last-node-marker"></p><table border="0" cellpadding="0" cellspacing="0" class="dr-tree-full-width rich-tree-node" id="treeForm:j_id2:106:107:j_id5"><tbody><tr id="treeForm:j_id2:106:107:j_id5:mainRow" onclick=" "><td class="dr-tree-h-ic rich-tree-node-handleicon dr-tree-h-ic-line-last"><div><a href="#" id="treeForm:j_id2:106:107:j_id5:handle" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:107:j_id5AjaxExpanded':true,'treeForm:j_id2:106:107:j_id5NodeExpanded':'true'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} ); return false;"><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-collapsed" id="treeForm:j_id2:106:107:j_id5:handle:img:collapsed" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreePlusImage/DATB/eAH7....72fXGBgYACWpBbU_" /><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" id="treeForm:j_id2:106:107:j_id5:handle:img:expanded" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeMinusImage/DATB/eAH7....72fXGBgYACWpBbU_" style="display: none;" /></a></div></td><td class="dr-tree-h-ic rich-tree-node-icon dr-tree-h-ic-line-clp" id="treeForm:j_id2:106:107:j_id5:icon" rich:draggableoptions="{'parameters':{'dragSourceId':'treeForm:j_id2:106:107:j_id5','treeForm:j_id2:106:107:j_id5':'treeForm:j_id2:106:107:j_id5'} } " rich:dropzoneoptions="{} "><img class="dr-tree-h-ic-img-md dr-tree-h-ic-img" src="/polyus/**/a4j_3_1_6.GAimages/iconFolder.gif" /></td><td class="dr-tree-h-text rich-tree-node-text " id="treeForm:j_id2:106:107:j_id5:text" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted treeLink" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected selectedNode">Senior management<input type="checkbox" name="treeForm:j_id2:106:107:j_id7" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:107:j_id8':'treeForm:j_id2:106:107:j_id8'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} )" /></td></tr></tbody></table><div id="treeForm:j_id2:106:107:j_id5:childs" style="display: none;" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-children rich-tree-node-cildren"></div></div><div id="treeForm:j_id2:script"><script type="text/javascript">Richfaces_Tree_treeForm_j_id2.getNodeElements(['treeForm:j_id2:106:j_id3'] );</script></div><input type="hidden" id="treeForm:j_id2:input" name="treeForm:j_id2:input" value="" /></div><meta name="Ajax-Update-Ids" content="treeForm:j_id2:106:j_id3,treeForm:j_id2:106:j_id3:childs,treeForm:j_id2:script,treeForm:j_id2:input" /><span id="ajax-view-state"><span id="org.ajax4jsf.view.state" name="org.ajax4jsf.view.state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id4" /></span></span><meta id="Ajax-Response" name="Ajax-Response" content="true" />
          debug[23:34:19,925]: Header Ajax-Expired not found, search in <meta>
          error[23:34:19,926]: Error parsing XML
          error[23:34:19,926]: Parse Error: Document is empty
          debug[23:34:19,926]: No parsed XML document in response
          

          • 2. Re: Problems using rich:tree with seam
            Anton Polyakov Newbie

            I'm not sure is I posted the RF debug info. During ajax submitting it shows the following:


            debug[23:34:19,761]: Have Event [object Object] with properties: target: [object HTMLImageElement], srcElement: undefined, type: click
            debug[23:34:19,761]: NEW AJAX REQUEST !!! with form :treeForm
            debug[23:34:19,762]: Append hidden control treeForm:j_id2:input with value [] and value attribute []
            debug[23:34:19,763]: Append hidden control treeForm with value [treeForm] and value attribute [treeForm]
            debug[23:34:19,764]: Append hidden control autoScroll with value [] and value attribute []
            debug[23:34:19,764]: Append hidden control javax.faces.ViewState with value [_id4] and value attribute [_id4]
            debug[23:34:19,765]: parameter treeForm:j_id2:106:j_id3AjaxExpanded with value true
            debug[23:34:19,765]: parameter treeForm:j_id2:106:j_id3NodeExpanded with value true
            debug[23:34:19,766]: Start XmlHttpRequest
            debug[23:34:19,768]: Reqest state : 1
            debug[23:34:19,769]: QueryString: AJAXREQUEST=_viewRoot&treeForm%3Aj_id2%3Ainput=&treeForm=treeForm&autoScroll=&javax.faces.ViewState=_id4&treeForm%3Aj_id2%3A106%3Aj_id3AjaxExpanded=true&treeForm%3Aj_id2%3A106%3Aj_id3NodeExpanded=true&
            debug[23:34:19,770]: Reqest state : 1
            debug[23:34:19,924]: Reqest state : 2
            debug[23:34:19,924]: Reqest state : 3
            debug[23:34:19,924]: Reqest state : 3
            debug[23:34:19,924]: Reqest state : 4
            debug[23:34:19,925]: Reqest end with state 4
            debug[23:34:19,925]: Response with content-type: text/html;charset=UTF-8
            debug[23:34:19,925]: Full response content: <div xmlns:rich="http://richfaces.ajax4jsf.org/rich"><script src="/polyus/**/a4j_3_1_6.GAorg.ajax4jsf.javascript.PrototypeScript" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/json/json-mini.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg.ajax4jsf.javascript.DnDScript" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/utils.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/json/json-dom.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-common.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-dropzone.js" type="text/javascript"></script><script src="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/scripts/dnd/dnd-draggable.js" type="text/javascript"></script><link href="/polyus/**/a4j_3_1_6.GAorg/richfaces/renderkit/html/css/dragIndicator.xcss/DATB/eAFjlbr0AAAC6gHS" type="text/css" rel="stylesheet" /><table border="0" cellpadding="0" cellspacing="0" class="dr-tree-full-width rich-tree-node" id="treeForm:j_id2:106:j_id3"><tbody><tr id="treeForm:j_id2:106:j_id3:mainRow" onclick=" "><td class="dr-tree-h-ic rich-tree-node-handleicon dr-tree-h-ic-line-node" style="background-image:expression(this.parentNode.parentNode.parentNode.nextSibling.nextSibling ? 'url(/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeLineNodeImage/DATB/eAH7....72fXGBgYACWpBbU_)' : 'url(/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeLineLastImage/DATB/eAH7....72fXGBgYACWpBbU_)')"><div><a href="#" id="treeForm:j_id2:106:j_id3:handle" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:j_id3AjaxExpanded':true,'treeForm:j_id2:106:j_id3NodeExpanded':'false'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} ); return false;"><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-collapsed" id="treeForm:j_id2:106:j_id3:handle:img:collapsed" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreePlusImage/DATB/eAH7....72fXGBgYACWpBbU_" style="display: none;" /><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" id="treeForm:j_id2:106:j_id3:handle:img:expanded" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeMinusImage/DATB/eAH7....72fXGBgYACWpBbU_" /></a></div></td><td class="dr-tree-h-ic rich-tree-node-icon dr-tree-h-ic-line-exp" id="treeForm:j_id2:106:j_id3:icon" rich:draggableoptions="{'parameters':{'dragSourceId':'treeForm:j_id2:106:j_id3','treeForm:j_id2:106:j_id3':'treeForm:j_id2:106:j_id3'} } " rich:dropzoneoptions="{} "><img class="dr-tree-h-ic-img-md dr-tree-h-ic-img" src="/polyus/**/a4j_3_1_6.GAimages/iconFolder.gif" /></td><td class="dr-tree-h-text rich-tree-node-text " id="treeForm:j_id2:106:j_id3:text" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted treeLink" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected selectedNode">MobiOffice</td></tr></tbody></table><div id="treeForm:j_id2:106:j_id3:childs" style="background-image:expression(this.nextSibling ? '' : 'none')" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-children rich-tree-node-cildren dr-tree-h-ic-line"><p class="dr-tree-last-node-marker"></p><table border="0" cellpadding="0" cellspacing="0" class="dr-tree-full-width rich-tree-node" id="treeForm:j_id2:106:107:j_id5"><tbody><tr id="treeForm:j_id2:106:107:j_id5:mainRow" onclick=" "><td class="dr-tree-h-ic rich-tree-node-handleicon dr-tree-h-ic-line-last"><div><a href="#" id="treeForm:j_id2:106:107:j_id5:handle" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:107:j_id5AjaxExpanded':true,'treeForm:j_id2:106:107:j_id5NodeExpanded':'true'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} ); return false;"><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-collapsed" id="treeForm:j_id2:106:107:j_id5:handle:img:collapsed" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreePlusImage/DATB/eAH7....72fXGBgYACWpBbU_" /><img border="0" class="dr-tree-pointer-cursor dr-tree-h-ic-img-md dr-tree-h-ic-img rich-tree-node-handleicon-expanded" id="treeForm:j_id2:106:107:j_id5:handle:img:expanded" src="/polyus/**/a4j_3_1_6.GAorg.richfaces.renderkit.html.images.TreeMinusImage/DATB/eAH7....72fXGBgYACWpBbU_" style="display: none;" /></a></div></td><td class="dr-tree-h-ic rich-tree-node-icon dr-tree-h-ic-line-clp" id="treeForm:j_id2:106:107:j_id5:icon" rich:draggableoptions="{'parameters':{'dragSourceId':'treeForm:j_id2:106:107:j_id5','treeForm:j_id2:106:107:j_id5':'treeForm:j_id2:106:107:j_id5'} } " rich:dropzoneoptions="{} "><img class="dr-tree-h-ic-img-md dr-tree-h-ic-img" src="/polyus/**/a4j_3_1_6.GAimages/iconFolder.gif" /></td><td class="dr-tree-h-text rich-tree-node-text " id="treeForm:j_id2:106:107:j_id5:text" rich:highlightedclass="dr-tree-i-hl rich-tree-node-highlighted treeLink" rich:selectedclass="dr-tree-i-sel rich-tree-node-selected selectedNode">Senior management<input type="checkbox" name="treeForm:j_id2:106:107:j_id7" onclick="A4J.AJAX.Submit('_viewRoot','treeForm',event,{'parameters':{'treeForm:j_id2:106:107:j_id8':'treeForm:j_id2:106:107:j_id8'} ,'actionUrl':'/polyus/calendar/addParticipantsPopup.seam?javax.portlet.faces.DirectLink=true'} )" /></td></tr></tbody></table><div id="treeForm:j_id2:106:107:j_id5:childs" style="display: none;" class="dr-tree-layout-on dr-tree-h-ic-div rich-tree-node-children rich-tree-node-cildren"></div></div><div id="treeForm:j_id2:script"><script type="text/javascript">Richfaces_Tree_treeForm_j_id2.getNodeElements(['treeForm:j_id2:106:j_id3'] );</script></div><input type="hidden" id="treeForm:j_id2:input" name="treeForm:j_id2:input" value="" /></div><meta name="Ajax-Update-Ids" content="treeForm:j_id2:106:j_id3,treeForm:j_id2:106:j_id3:childs,treeForm:j_id2:script,treeForm:j_id2:input" /><span id="ajax-view-state"><span id="org.ajax4jsf.view.state" name="org.ajax4jsf.view.state"><input type="hidden" name="javax.faces.ViewState" id="javax.faces.ViewState" value="_id4" /></span></span><meta id="Ajax-Response" name="Ajax-Response" content="true" />
            debug[23:34:19,925]: Header Ajax-Expired not found, search in <meta>
            error[23:34:19,926]: Error parsing XML
            error[23:34:19,926]: Parse Error: Document is empty
            debug[23:34:19,926]: No parsed XML document in response
            

            • 3. Re: Problems using rich:tree with seam
              Henrik Steudel Newbie

              could not read through all your post but as far as I found out when I worked with rich:tree it may be related to following facts:


              I estimate that your UsersStructureTreeNode is extended from org.richfaces.model.TreeNode which expects to be parametrized with an object. Thats an object where you put your custom data in.
              This object is referred to as data-property which is set when adding children to a node. That's why the rootnode is not shown in the tree.


              the rich:tree value attribute must bind to the root treenode whereas the val attribute is referring automagically to the data property of the treenode (your custom data holder so to say). So item.type etc is referring to getData().getType() of the treenode.
              Maybe I don't understand it correctly but I have no clue why there is a need for a custom treenode class...


              Additionally the treenode-object has an object id which is also set when adding children to a node (preferrably a string) and is used to construct ListRowKeys which you need for expanding etc.


              So as far as I understand there is a problem with this identifier when casting it to a string.



              Caused by: java.lang.ClassCastException: java.lang.String
              at org.richfaces.model.StackingTreeModel.doSetupKey(StackingTreeModel.java:129)
              at org.richfaces.model.StackingTreeModel.setupKey(StackingTreeModel.java:167)
              at org.richfaces.model.StackingTreeModel.setRowKey(StackingTreeModel.java:460)
              at org.ajax4jsf.component.UIDataAdaptor.setRowKey(UIDataAdaptor.java:339)
              



              • 4. Re: Problems using rich:tree with seam
                Anton Polyakov Newbie

                Thank you for your answer, but when I add children I use exactly string, like


                usersStructure .add(child.getId().toString, child);
                


                The problem occurs during Ajax render response phase and somehow related a4j: reRender attribute

                • 5. Re: Problems using rich:tree with seam
                  Anton Polyakov Newbie

                  Thanks to everybody. The problem with Ajax events finally was solved.
                  That was caused by web.xml which ontained:


                       <filter-mapping>
                            <filter-name>Seam Filter</filter-name>
                            <url-pattern>/**/*</url-pattern>
                       </filter-mapping>
                  


                  When I changed this to


                      <filter-mapping>
                          <filter-name>Seam Filter</filter-name>
                          <url-pattern>/*</url-pattern>
                      </filter-mapping>
                  


                  Everything began working fine!