0

I have a jsf page index.xhtml

<!DOCTYPE html>
<html lang="en"
     xmlns="http://www.w3.org/1999/xhtml"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
>
    <h:head>
        <title>Index Page</title>
    </h:head>
    <h:body>
        <p:layout fullPage="true">
            <p:layoutUnit position="north" size="100" resizable="false" closable="false" collapsible="false">
                <h:form>
                    <ui:include src="../header.xhtml" />
                </h:form>
            </p:layoutUnit>

            <p:layoutUnit position="west" size="200" resizable="false" closable="false" collapsible="false">
                <h:form>
                    <ui:include src="../leftpanel.xhtml" />
                </h:form>
            </p:layoutUnit>


            <p:layoutUnit position="center">
                <ui:insert name="content">Blank</ui:insert>
            </p:layoutUnit>
        </p:layout>
    </h:body>
</html>

The layout of above page is somewhat like this

-------------------------------------------------------
|                                                      |
|                  <header>                            |
|______________________________________________________|
|               |                                      |
|               |                                      |
|      <left>   |         <center>                     |
|               |                                      |
|               |                                      |
|_______________|______________________________________| 

I am using Primefaces 3.x and JSF 2.x. I have a requirement where there are links on left layout like menu and their submenus, on click of submenu items them, a page should get opened in center layout. Can somebody guide me, how to do it?

Namita
  • 779
  • 4
  • 12
  • 24
  • check this ....http://stackoverflow.com/questions/10444584/primefaces-page-layout-with-tree-menu-as-navigation/10445869#10445869 – rags Sep 12 '12 at 11:24

1 Answers1

-1

You have to define in your xhtml pages with contents

...
<h:body>
    <ui:composition template="index.xhtml">
        <ui:define name="content">
    </ui:composition>
</h:body>
...

And links in menu/submenu have to return outcomes defined in faces-config, for example:

<navigation-rule>
    <from-view-id>/*</from-view-id>
    <navigation-case>
        <from-outcome>subemnu1</from-outcome>
        <to-view-id>/submenu1.xhtml</to-view-id>
    </navigation-case>
</navigation-rule>
tomi
  • 706
  • 1
  • 6
  • 21