Primefaces page layout with tree menu as navigation

后端 未结 2 1059
孤街浪徒
孤街浪徒 2020-12-20 01:36

I am using primefaces 3.1 with `, having four positions. In the west position(west) I have added tree menu. JSF code is follows



        
相关标签:
2条回答
  • 2020-12-20 02:08

    This is achieved with the help of layout. Define layout template for your application. Sample is shown here ...

    myLayoutTemplate.xhtml

           <p:layout>
            <p:layoutUnit position="east" header="Menu"  collapsed="true" scrollable="true" collapsible="true" >
                <ui:insert name="appMenu">
                    Place Your menu here ...
                </ui:insert>
            </p:layoutUnit>
    
            <p:layoutUnit position="center" scrollable="true">
                <ui:insert name="pageContent">
                    Page Content is loaded here .....
                </ui:insert>
            </p:layoutUnit>
        </p:layout>
    

    In Your Page.xhtml which is to be loaded on click of your menu item, .....

    <ui:composition template="myLayoutTemplate.xhtml">
        <ui:define name="pageContent">
    
        </ui:define>
    </ui:composition>
    
    0 讨论(0)
  • 2020-12-20 02:19

    I think that this post will be very useful for you Include one xhtml inside another JSF

    It describes how you create a template and then use it in your template client. @rags already told you that, but you don't really have to use <p:layout>. Article linked above is just more precise. I believe you will find what you need there. Regards

    0 讨论(0)
提交回复
热议问题