Salve Salve galera do guj.
Utilizando o primefaces 2.2.1 com o layoutunit center, bottom, right, left e top…
Onde no left tem os menus com os commandlink que ao clicar nele carrega os formularios.xhtml no layoutUnit center.
veja o código logo a baixo
index.xhtml
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>Sistema de Cadastro</title>
</h:head>
<h:body>
<!-- Top -->
<p:layout fullPage="true">
<p:layoutUnit position="top" height="75">
<center><h1>Sistema de Cadastro</h1></center>
</p:layoutUnit>
<!-- Menu a esquerda -->
<p:layoutUnit position="left" header="Menu" width="200" resizable="true" closable="true" collapsible="true">
<p:accordionPanel activeIndex="0" autoHeight="false">
<p:tab title="Cadastro">
<h:form>
<p:commandLink update="centro" action="/formCadCli.xhtml" value="Cadastrar Cliente"/>
</h:form>
</p:tab>
<p:tab title="Clientes">
</p:tab>
<p:tab title="Solicitações">
</p:tab>
</p:accordionPanel>
</p:layoutUnit>
<!-- Direito -->
<p:layoutUnit position="right" width="325" header="Atividades" resizable="false" closable="true" collapsible="true">
<h:form>
<br/><p:calendar pattern="dd/MM/yyyy" locale="pt_BR" value="#{componentesView.data}" mode="inline" navigator="true"/><br/>
<h:outputText value="#{componentesView.data.time}">
<f:convertDateTime timeStyle="default" pattern="HH:mm:ss" timeZone="UTC-3" />
</h:outputText>
</h:form>
</p:layoutUnit>
<!-- Centro -->
<p:layoutUnit id="centro" position="center" header="Sistema" >
</p:layoutUnit>
<!-- Inferior -->
<p:layoutUnit id="bottom" position="bottom" height="50" zindex="0" scrollable="null">
Sistema de Cadastro 1.2
</p:layoutUnit>
</p:layout>
</h:body>
</html>
formCadCli.xhtml
<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>TODO supply a title</title>
</head>
<body>
<h1>Cadastro de Cliente</h1>
</body>
</html>
O que eu não estou conseguindo ai é carregar o formCadCli.xhtml dentro no layoutUnit center para poder manipular este formulario no centro da página.
Tem como fazer isto?
Abraços!