Primefaces 3.5 + Layout não reconhece forms

0 respostas
furacao123

tenho uma aplicação em JSF + Primefaces 2 feito ja faz um tempo, funcionando perfeitamente, resolvi utilizar o mesmo esquema de layout e componentes do PrimeFaces, mas quero utilizar a versão 3 do Primefaces, feito isso comecei a ter problemas com os forms do template, alguem ja passou por isso?

Segue as paginas jsf

home.xhtml
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="../resources/template.xhtml">
        
        <ui:define name="login">
            <ui:include src="../resources/usuarioLogado.xhtml"/>
        </ui:define>

        <ui:define name="menu">
            <ui:include src="../resources/menu.xhtml" />
        </ui:define>

    </ui:composition>

</html>

template.xhtml

<h:body>
        <p:growl id="growlMessage" showDetail="true" />

        <ui:insert name="body">
            <p:layout fullPage="true">

                <p:layoutUnit position="top" height="52">
                    <p:panel id="pnl-topo" styleClass="topo">
                        <ui:insert name="login">
                            <ui:include src="usuarioLogado.xhtml"/>
                        </ui:insert>
                    </p:panel>
                </p:layoutUnit>

                <p:layoutUnit position="center" closable="false">
					<p:outputPanel id="pnlMenu"
						rendered="#{sec:ifAnyGranted('ROLE_ADMIN')}">
						<ui:insert name="menu">
							<ui:include src="menu.xhtml" />
						</ui:insert>
					</p:outputPanel>
					<br/>
                    &lt;p:outputPanel id=&quot;pnlCorpo&quot;&gt;
                        &lt;ui:insert name=&quot;corpo&quot;&gt;
                            &lt;ui:include src=&quot;#{menuController.menuSelected}&quot;/&gt;
                        &lt;/ui:insert&gt;
                    &lt;/p:outputPanel&gt;
                &lt;/p:layoutUnit&gt;

                &lt;p:layoutUnit position=&quot;bottom&quot; height=&quot;75&quot;&gt;  
                    &lt;ui:include src=&quot;rodape.xhtml&quot;/&gt;
                &lt;/p:layoutUnit&gt;

            &lt;/p:layout&gt;

			&lt;ui:include src=&quot;dlgAlterarSenha.xhtml&quot; /&gt;

            &lt;p:outputPanel id=&quot;pnlDialog&quot; rendered=&quot;#{menuController.hasDialog}&quot;&gt;
                &lt;ui:insert name=&quot;dialog&quot;&gt;
                    &lt;ui:include src=&quot;#{menuController.dialogSelected}&quot;/&gt;
                &lt;/ui:insert&gt;
            &lt;/p:outputPanel&gt;

        &lt;/ui:insert&gt;
    &lt;/h:body&gt;

dlgAlterarSenha.xhtml

&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;!DOCTYPE html&gt;
&lt;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.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets"&gt;

    &lt;p:dialog id="dlgAlterarSenha" widgetVar="dlgAlterarSenha" header="Alterar Senha"
              resizable="false" width="250" height="170" modal="true" showEffect="clip"&gt;
        &lt;h:form prependId="false"&gt;
            &lt;h:panelGrid id="pnlAlterarSenha" columns="2"&gt;
                &lt;h:outputLabel for="txtSenhaAtual" value="Senha Atual"/&gt;
                &lt;p:password id="txtSenhaAtual" value="#{loginController.senhaAtual}" feedback="false" required="true" minLength="1"/&gt;

                &lt;h:outputLabel for="txtSenhaNova" value="Senha Nova"/&gt;
                &lt;p:password id="txtSenhaNova" value="#{loginController.senhaNova}" feedback="false" required="true" minLength="1"/&gt;

                &lt;h:outputLabel for="txtSenhaConfirma" value="Confirmação"/&gt;
                &lt;p:password id="txtSenhaConfirma" value="#{loginController.senhaConfirmacao}" feedback="false" required="true" minLength="1" /&gt;
                <br/><br/>
                &lt;f:facet name="footer"&gt;
                    &lt;p:commandButton value="Salvar" styleClass="btn-texto" image="btn-aceito" update="growlMessage"
                                     action="#{loginController.salvarNovaSenha}" oncomplete="dlgAlterarSenha.hide()" /&gt;
                    &lt;p:commandButton value="Cancelar" type="buttom" onclick="dlgAlterarSenha.hide()" 
                                     styleClass="btn-texto" image="btn-cancelar"/&gt;
                &lt;/f:facet&gt;
            &lt;/h:panelGrid&gt;
        &lt;/h:form&gt;
    &lt;/p:dialog&gt;

&lt;/html&gt;
usuarioLogado.xhtml
&lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&gt;
&lt;!DOCTYPE html&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"&gt;

    &lt;h:form prependId="false"&gt;
        &lt;p:panel styleClass="pnl-topo"&gt;
            &lt;h:graphicImage url="${facescontext.currentinstance}/img/empresa.png" styleClass="borda-ie"/&gt;
            &lt;h:graphicImage url="${facescontext.currentinstance}/img/usuario.png" styleClass="borda-ie"/&gt;
            &lt;h:outputText value=" #{loginController.usuarioLogado}  [ "/&gt;
            &lt;p:commandLink id="lnkAlterarSenha" value="Alterar Senha" update="pnlAlterarSenha" 
                           oncomplete="dlgAlterarSenha.show()"/&gt;
            &lt;h:outputText value=" | "/&gt;
            &lt;p:commandLink action="#{loginController.logout}" value="Sair" process="@this"/&gt;
            &lt;h:outputText value=" ]"/&gt;
        &lt;/p:panel&gt;
    &lt;/h:form&gt;

&lt;/html&gt;

Ao executar o login dispara a mensagem

Cannot find component with identifier "pnlAlterarSenha" referenced from "lnkAlterarSenha".

Obs: Esse template funciona normalmente no Primefaces 2

Criado 20 de maio de 2013
Respostas 0
Participantes 1