3 Replies Latest reply on Oct 9, 2009 9:39 AM by mcremolini

    Problems using two rich tree

      Hi,
      I have strange problem with tree component.
      Both trees have different back beans (different classes but same functionality) and different id-s.
      Debugging my code i discover that when i expand a node of the second tree is used the back bean of the first tree and it's necessary a second click for proper operation.

      thanks for help me
      matteo

        • 1. Re: Problems using two rich tree
          ilya_shaikovsky

          add code please and version info.

          • 2. Re: Problems using two rich tree

            the version is 3.3.2
            thanks

            1 tree
            ---------------

            <a4j:outputPanel id="treePanel" ajaxRendered="true"
            styleClass="vertical-align: top">
            <rich:tree id="localTree" style="width:300px" switchType="ajax"
            ajaxSubmitSelection="true" ajaxSingle="true"
            iconLeaf="/images/tree/closeFolder.gif"
            icon="/images/tree/closeFolder.gif"
            iconCollapsed="/images/tree/collapsed.gif"
            iconExpanded="/images/tree/expanded.gif"
            nodeSelectListener="#{alfrescoBean.processSelection}"
            reRender="documenti">
            <rich:recursiveTreeNodesAdaptor roots="#{alfrescoBean.sourceRoots}"
            var="item" nodes="#{item.nodes}">
            <rich:treeNode>
            <h:outputText value="#{item.name}" />
            </rich:treeNode>
            </rich:recursiveTreeNodesAdaptor>
            </rich:tree>
            </a4j:outputPanel>



            2 tree
            ---------------
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <ui:composition xmlns="http://www.w3.org/1999/xhtml"
            xmlns:ui="http://java.sun.com/jsf/facelets"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:rich="http://richfaces.org/rich"
            xmlns:a4j="http://richfaces.org/a4j"
            xmlns:sdp="http://it.senato.sdp/sdp"
            xmlns:c="http://java.sun.com/jstl/core">

            <a4j:region id="treeRegion" selfRendered="true">
            <rich:modalPanel id="ModalCopy" width="350" height="100"
            showWhenRendered="true">
            <f:facet name="header">
            <h:panelGroup>
            <h:outputText value="Modal Panel"></h:outputText>
            </h:panelGroup>
            </f:facet>
            <f:facet name="controls">
            <h:panelGroup>
            <h:graphicImage value="/images/modal/close.png"
            styleClass="hidelink" id="hidelink" />
            <rich:componentControl for="ModalCopy" attachTo="hidelink"
            operation="hide" event="onclick" />
            </h:panelGroup>
            </f:facet>
            <a4j:form id="treeForm">

            <a4j:outputPanel id="copyTreePanel" ajaxRendered="true"
            styleClass="vertical-align: top">
            <rich:tree id="copytree" style="width:300px" switchType="ajax"
            ajaxSubmitSelection="true" ajaxSingle="true"
            iconLeaf="/images/tree/closeFolder.gif"
            icon="/images/tree/closeFolder.gif"
            iconCollapsed="/images/tree/collapsed.gif"
            iconExpanded="/images/tree/expanded.gif"
            nodeSelectListener="#{alfrescoBeanCopyFromLocal.processSelection}"
            reRender="treeRegion">
            <rich:recursiveTreeNodesAdaptor
            roots="#{alfrescoBeanCopyFromLocal.sourceRoots}" var="currItem"
            nodes="#{currItem.nodes}">
            <rich:treeNode>
            <h:outputText value="#{currItem.name}" />
            </rich:treeNode>
            </rich:recursiveTreeNodesAdaptor>
            </rich:tree>
            </a4j:outputPanel>
            </a4j:form>

            </rich:modalPanel>
            </a4j:region>
            </ui:composition>



            • 3. Re: Problems using two rich tree

              the version is 3.3.2
              thanks

              1 tree
              ---------------

              <a4j:outputPanel id="treePanel" ajaxRendered="true"
               styleClass="vertical-align: top">
               <rich:tree id="localTree" style="width:300px" switchType="ajax"
               ajaxSubmitSelection="true" ajaxSingle="true"
               iconLeaf="/images/tree/closeFolder.gif"
               icon="/images/tree/closeFolder.gif"
               iconCollapsed="/images/tree/collapsed.gif"
               iconExpanded="/images/tree/expanded.gif"
               nodeSelectListener="#{alfrescoBean.processSelection}"
               reRender="documenti">
               <rich:recursiveTreeNodesAdaptor roots="#{alfrescoBean.sourceRoots}"
               var="item" nodes="#{item.nodes}">
               <rich:treeNode>
               <h:outputText value="#{item.name}" />
               </rich:treeNode>
               </rich:recursiveTreeNodesAdaptor>
               </rich:tree>
               </a4j:outputPanel>
              
              


              2 tree
              ---------------
              <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
              <ui:composition xmlns="http://www.w3.org/1999/xhtml"
               xmlns:ui="http://java.sun.com/jsf/facelets"
               xmlns:f="http://java.sun.com/jsf/core"
               xmlns:h="http://java.sun.com/jsf/html"
               xmlns:rich="http://richfaces.org/rich"
               xmlns:a4j="http://richfaces.org/a4j"
               xmlns:sdp="http://it.senato.sdp/sdp"
               xmlns:c="http://java.sun.com/jstl/core">
              
               <a4j:region id="treeRegion" selfRendered="true">
               <rich:modalPanel id="ModalCopy" width="350" height="100"
               showWhenRendered="true">
               <f:facet name="header">
               <h:panelGroup>
               <h:outputText value="Modal Panel"></h:outputText>
               </h:panelGroup>
               </f:facet>
               <f:facet name="controls">
               <h:panelGroup>
               <h:graphicImage value="/images/modal/close.png"
               styleClass="hidelink" id="hidelink" />
               <rich:componentControl for="ModalCopy" attachTo="hidelink"
               operation="hide" event="onclick" />
               </h:panelGroup>
               </f:facet>
               <a4j:form id="treeForm">
              
               <a4j:outputPanel id="copyTreePanel" ajaxRendered="true"
               styleClass="vertical-align: top">
               <rich:tree id="copytree" style="width:300px" switchType="ajax"
               ajaxSubmitSelection="true" ajaxSingle="true"
               iconLeaf="/images/tree/closeFolder.gif"
               icon="/images/tree/closeFolder.gif"
               iconCollapsed="/images/tree/collapsed.gif"
               iconExpanded="/images/tree/expanded.gif"
               nodeSelectListener="#{alfrescoBeanCopyFromLocal.processSelection}"
               reRender="treeRegion">
               <rich:recursiveTreeNodesAdaptor
               roots="#{alfrescoBeanCopyFromLocal.sourceRoots}" var="currItem"
               nodes="#{currItem.nodes}">
               <rich:treeNode>
               <h:outputText value="#{currItem.name}" />
               </rich:treeNode>
               </rich:recursiveTreeNodesAdaptor>
               </rich:tree>
               </a4j:outputPanel>
               </a4j:form>
              
               </rich:modalPanel>
               </a4j:region>
              </ui:composition>