Olá, gostaria de tirar uma dúvida com JSF 2.0 + Primefaces 3.1.1 + Facelets.
É o seguinte:
Tenho uma página com alguns campos primefaces:
<!-- NewFile.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:p="http://primefaces.org/ui"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title>Facelet Title</title>
</h:head>
<h:body>
<h:form id="mainForm" styleClass="mainForm" prependId="false">
<h:panelGrid columns="1" cellpadding="5">
<p:commandButton value="Basic" onclick="dlg1.show();" type="button" />
<p:commandButton value="Modal" onclick="dlg2.show();" type="button" />
<p:commandButton value="Effects" onclick="dlg3.show();" type="button" />
</h:panelGrid>
<p:dialog widgetVar="dlg1">
<ui:include src="/movdiginfo.xhtml" />
</p:dialog>
<p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true"
height="200">
<h:outputText value="This is a Modal Dialog." />
</p:dialog>
<p:dialog header="Effect Dialog" widgetVar="dlg3" showEffect="bounce"
hideEffect="explode" height="200">
<h:outputText value="This dialog has cool effects." />
</p:dialog>
</h:form>
</h:body>
</html>
e um template:
<!-- template.xhtml -->
<!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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<h:head>
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/resources/css/fontes.css" />
<link type="text/css" rel="stylesheet"
href="#{request.contextPath}/resources/css/estilo.css" />
</h:head>
<h:body>
<div id="header">
<ui:insert name="header">
<ui:include src="/WEB-INF/templates/header.xhtml" />
</ui:insert>
</div>
<div id="content">
<div class="centraliza1024Content">
<div style="float: left; width: 20%;">
<ui:insert name="menu">
<ui:include src="/WEB-INF/templates/menu.xhtml"></ui:include>
</ui:insert>
</div>
<div style="float: right; width: 80%;">
<ui:insert name="content">
</ui:insert>
</div>
</div>
</div>
<div id="footer">
<ui:insert name="footer">
<ui:include src="/WEB-INF/templates/footer.xhtml" />
</ui:insert>
</div>
</h:body>
</html>
SE eu herdar a pagina NewFile.xhtml desse template, meus componentes primefaces são renderizados, porém NÃO são executados, ou seja, os “dialog” não funcionam.
Alguém sabe o por quê ?