4 Replies Latest reply on Mar 31, 2011 3:56 AM by jobmathew

    Panel side bar menu with tree view and dymanic menu items

    jobmathew

      HI All,

       

                  Currently i was trying to develop a side bar menu. with a panel bar. which is having a 4 panel bar.

       

      where first one will have a tree view and the rest 3 will have dynamic number of menu items.

       

      First problem am facing is i dont know how to navigate to a different page when selecting an item from tree view  togather with sending the id of tree node .

       

      second problem is i dont know how to add dynamic menu items and to navigateto different pages with parameters of the menu item.

       

      can any one please help me...

       

      thank you so much

        • 1. Panel side bar menu with tree view and dymanic menu items
          ilya_shaikovsky
          First problem am facing is i dont know how to navigate to a different page when selecting an item from tree view  togather with sending the id of tree node .

           

           

          just use render attribute to update the content part like there (http://livedemo.exadel.com/richfaces-demo/richfaces/tree.jsf?tab=dnd&cid=402622) unfortunatelly has no 4.x sample but ti should be easy to adopt.

           

          second problem is i dont know how to add dynamic menu items and to navigateto different pages with parameters of the menu item.

           

          use http://is.gd/vRtm4T

          • 2. Re: Panel side bar menu with tree view and dymanic menu items
            jobmathew

            i have created a below template and when clicking on side menu which contains tree view or menu items from the pannel menu.

             

            i want to update only the mainDisplay area. is it possible ????

             

            currently what am doing is i make an action which call a function in the bean and return a string value which is given in the faces-config and will redirect to corresponding page which uses the below template.

             

            <f:view 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:a="http://richfaces.org/a4j"

                    xmlns:rich="http://richfaces.org/rich"

                    contentType="text/html">

                <html>

                    <head>

                        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />

                        <title>Welcome </title>   

                    </head>

                    <body>     

                          <div id="wrapper">            

                             <div  id="header">            

                                     <div align="right" id= "menu">

                                         <ui:include name="menu" src="/Resource/HeaderToolbar.xhtml" />

                                     </div>                    

                             </div>

                             <rich:panel>             

                                 <table border="0">

                                    <tr>

                                      <th valign="top" width="350px"><ui:include name="menu" src="/Resource/SideBarMenu.xhtml" /></th>

                                      <td valign="top" width="100%"><ui:insert name="mainDisplay" /></td>

                                     </tr>

                              </table>

                          </rich:panel> 

                            <div id="footer" align="center"> 

                                    <rich:panel>

                                   <h:outputText value="Copyright © 2011." />

                                   </rich:panel>

                            </div>

                        </div>  

                        <ui:debug hotkey="c" rendered="true"/>   

                    </body>

                </html> 

            </f:view>

            • 3. Re: Panel side bar menu with tree view and dymanic menu items
              ilya_shaikovsky

              probably you should use not insert but include.. Then you will be able to change included pages rendering parent component for that include.

              • 4. Re: Panel side bar menu with tree view and dymanic menu items
                jobmathew

                if i am using include i have to use the "src" attribute and say excatly which page should be included right.

                 

                then how this page as my template for other pages !!!