3 Replies Latest reply on Apr 24, 2007 3:43 PM by sergeysmirnov

    Tree question

    konikoni

      Can i realize a navigation with tree, left a tree and on the right site i get new page included?

        • 1. Re: Tree question

          Do you mean the navigation implemented in http://livedemo.exadel.com/richfaces-demo or something else?

          • 2. Re: Tree question
            konikoni

             

            <rich:panel style="float:left;height:700px;margin-top:0px;margin-left:0px;overflow:none;">
             <a4j:region renderRegionOnly="false">
             <a4j:form>
             <rich:tree switchType="server" style="width:200px;" value="#{tmanager.data}" var="item" nodeFace="#{item.type}"
             ajaxSubmitSelection="true" nodeSelectListener="#{tmanager.selectNode}">
             <rich:treeNode type="root">
             <h:outputText value="#{item.type}" />
             </rich:treeNode>
             <rich:treeNode type="item">
             <h:outputText value="#{item.type}" />
             </rich:treeNode>
             <rich:treeNode type="child">
             <h:outputText value="#{item.type}" />
             </rich:treeNode>
             </rich:tree>
             </a4j:form>
             </a4j:region>
             </rich:panel>
             <s:div style="float:left;width:70%;margin-top:5px;margin-left:15px;margin-right:5px;">
            
             <a4j:form>
             <a4j:outputPanel ajaxRendered="true" >
             <a4j:region renderRegionOnly="false">
             <s:div id="fbearbeitung" rendered="#{tmanager.showPart == 1}">
             <a4j:include viewId="/fbearbeitung.xhtml" />
             </s:div>
             </a4j:region>
            
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 2}">
            
             <a4j:include viewId="/nfahrzeug.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 3}">
            
             <a4j:include viewId="/fabmodel.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 4}">
            
             <a4j:include viewId="/nmodel.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <!-- neue filiale-->
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 5}">
            
             <a4j:include viewId="/nfilliale.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <!-- filiale bearbeiten-->
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 6}">
            
             <a4j:include viewId="/filliale.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <!-- firmen daten-->
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 7}">
            
             <a4j:include viewId="/pedit.xhtml" />
            
             </s:div>
             </a4j:region>
            
             <!-- firmen daten-->
             <a4j:region renderRegionOnly="false">
             <s:div rendered="#{tmanager.showPart == 8}">
            
             <a4j:include viewId="/fsuche.xhtml" />
            
             </s:div>
             </a4j:region>
             </a4j:outputPanel>
            
            
             </a4j:form>
            
            
             </s:div>
             <br/>
             <br/>
             <br/>
             <br/>
             <s:div style="float:left;">
             <a4j:outputPanel ajaxRendered="true">
             <h:messages globalOnly="false" />
             </a4j:outputPanel>
             </s:div>
             </ui:define>


            I click on a leaf an right site will rerendered. I tried like that, but my bean must be in session scope, else doesn't work, like above, is this proceed okay, or have you another idea?


            • 3. Re: Tree question

              renderRegionOnly has false by default (since ajax4jsf 1.1.0). So, you do not need to mention this attribute any more explicitly.

              In general, your approach with global h:form and global a4j:outputPanel ajaxRendered="true" sounds very ineffective. I do not recommend you to proceed with it.