Fiz alguns testes e tem haver com eu estar aplicando uma classe css no body do template.
Estou aplicando a classe: styleClass=“pagina” no body do layout, senão a aplico, não ocorre o problema.
O layout tem 3 partes, topo, corpo e rodapé
No index redefino a área “corpo” do layout e no botão:
disparo a ação para o arquivo teste.xhtml.
Seguem os arquivos…
[size=18]layout.xhtml[/size]
[code]<?xml version=“1.0” encoding=“UTF-8”?>
<!DOCTYPE html>
<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:ui="http://java.sun.com/jsf/facelets"
xmlns:p=“http://primefaces.org/ui”>
<h:head><title>Teste</title></h:head>
<h:outputStylesheet library="css" name="style.css" />
<h:body styleClass="pagina">
<p:panelGrid>
<p:row >
<p:column colspan="3" >
<ui:insert name="cabecalho" >
<ui:include src="/template/topo.xhtml" />
</ui:insert>
</p:column>
</p:row>
<p:row>
<p:column width="22%" />
<p:column width="56%">
<ui:insert name="corpo" >
<ui:include src="/template/corpo.xhtml" />
</ui:insert>
</p:column>
<p:column width="22%" />
</p:row>
<p:row>
<p:column colspan="3" >
<ui:insert name="rodape" >
<ui:include src="/template/rodape.xhtml" />
</ui:insert>
</p:column>
</p:row>
</p:panelGrid>
</h:body>
</html>
[/code]
[size=18]style.css[/size]
[code]body.pagina{
background-color:cadetblue;
}
table.pagina{
horizontal-align: center;
}
fundo{
background-color: cadetblue;
}[/code]
[size=18]topo.xhtml[/size]
<ui:fragment
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:form>
<h:graphicImage value="/resources/images/Applied_Mathematics.jpg"/>
</h:form>
</ui:fragment>
[size=18]rodape.xhtml[/size]
<ui:fragment
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core">
<h:form>
<h:commandLink action="fornecedores"/>
</h:form>
</ui:fragment>
[size=18]index.xhtml[/size]
[code]<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:ui=“http://java.sun.com/jsf/facelets"
xmlns:p=“http://primefaces.org/ui”>
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<ui:composition template=”/template/layout.xhtml”>
<ui:define name=“corpo”>
<h:form id=“form” >
<div align=“center” >
<table style="height: 700px" width="100%">
<tr valign="middle" align="center">
<td>
<p:panel id="panel" style="width: 650px;">
<p:row>
<p:column>
<p:messages id="msgs"/>
</p:column>
</p:row>
<p:panelGrid id="panelGrid" style="width: 534px;">
<f:facet name="header">
<p:row>
<p:column colspan="2">Login</p:column>
</p:row>
</f:facet>
<p:row>
<p:column>
<h:outputLabel for="usuario" value="#{msg.loginUsuario}" />
</p:column>
<p:column>
<p:inputText id="usuario" label="#{msg.loginUsuario}" value="#{loginMB.usuario}" required="true" maxlength="8" size="10">
<f:validateLength minimum="2" />
</p:inputText>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel for="senha" value="#{msg.loginPass}"/>
</p:column>
<p:column>
<p:password id="senha" label="#{msg.loginPass}" value="#{loginMB.senha}" required="true" maxlength="8" size="10">
<f:validateLength minimum="2" />
</p:password>
</p:column>
</p:row>
<f:facet name="footer">
<p:row>
<p:column id="colunas" colspan="2" style="alignment-baseline: middle; " >
<p:commandButton type="submit" value="#{msg.botaoEntrar}" action="teste" update="panel" icon="ui-icon-person" />
</p:column>
</p:row>
</f:facet>
</p:panelGrid>
</p:panel>
</td>
</tr>
</table>
</div>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>[/code]
[size=18]teste.xhtml[/size]
[code]<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:ui=“http://java.sun.com/jsf/facelets"
xmlns:p=“http://primefaces.org/ui”>
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<ui:composition template=”/template/layout.xhtml”>
<ui:define name=“corpo”>
<h:form id=“form” >
<div align=“center” >
<table style="height: 700px" width="100%">
<tr valign="middle" align="center">
<td>
Teste
</td>
</tr>
</table>
</div>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>[/code]
Alguma sugestão do que pode ser esse problema?
Valeu!