Então galera, so novato com primefaces ^^, estou tendo o seguinte problema, tenho 2 p:commandLink pra mudar de pagina beleza, muda certinho… porem só funcionam os componentes da pagina que ja vem carregada, mando abrir a pagina downloads como 1, funciona certinho, mas qndo mudo pra pagina desprotetor, os componentes dela nao funcionam,e assim vice versa.
Segue o codigo, se alguem ja passou por isso e puder em ajudar fico grato.
topo.xhtml
[code]
<ui:fragment xmlns=“http://www.w3.org/1999/xhtml”
xmlns:h=“http://java.sun.com/jsf/html”
xmlns:p=“http://primefaces.prime.com.tr/ui”
xmlns:ui=“http://java.sun.com/jsf/facelets”
xmlns:f=“http://java.sun.com/jsf/core”
>
<h:form prependId="false">
<table width="100%" style=" font-size: 12px;">
<tr>
<td width="50%">
<h:outputText value="GUERAPA.COM" style="font-size:36px; text-align: center"/>
</td>
<td>
<a href="http://twitter.com/share" >Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
</td>
<td>
<h:panelGroup>
<p:commandLink action="#{paginasBean.paginaDesprotetor}" update="#{p:component('centro')}" ajax="false">
<p:graphicImage value="/images/cadeado.png" style="width: 50px; height: 50px;"/>
Guerapa Desprotetor
</p:commandLink>
</h:panelGroup>
</td>
<td>
<h:panelGroup>
<p:commandLink action="#{paginasBean.paginaDownloads}" update="#{p:component('centro')}" ajax="false">
<p:graphicImage value="/images/download.png" style="width: 50px; height: 50px;"/>
Guerapa Downloads
</p:commandLink>
</h:panelGroup>
</td>
<td>
<h:panelGroup>
<p:graphicImage value="/images/tutorial.png" style="width: 50px; height: 50px;"/>
Guerapa Tutoriais
</h:panelGroup>
</td>
</tr>
</table>
</h:form>
</ui:fragment>[/code]
index.html
[code]
<ui:composition xmlns=“http://www.w3.org/1999/xhtml”
xmlns:h=“http://java.sun.com/jsf/html”
xmlns:p=“http://primefaces.prime.com.tr/ui”
xmlns:ui=“http://java.sun.com/jsf/facelets”
xmlns:f=“http://java.sun.com/jsf/core”
template=“template.xhtml”>
<ui:define name="topo">
<ui:include src="topo.xhtml"/>
</ui:define>
<ui:define name="centro">
<h:form id=“formCentro”>
<p:outputPanel id=“centro”>
<ui:include src="#{paginasBean.paginaPrincipal}"/>
</p:outputPanel>
</h:form>
</ui:define>[/code]
desprotetor.xhtml
[code]<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”
xmlns:p=“http://primefaces.prime.com.tr/ui”>
<p:commandButton value="Converter" action="#{desprotetorBean.faz}">
</p:commandButton>
</ui:fragment>[/code]
downloads.xhtml
[code]<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”
xmlns:p=“http://primefaces.prime.com.tr/ui”>
<table align="center">
<tr>
<td align="center">
<h:panelGrid columns="3" style="">
<h:outputLabel value="Filtro: "/>
<h:inputText id="textoBusca" value="#{buscaPost.textoBusca}" size="100">
<p:ajax event="keyup" process="textoBusca" listener="#{buscaPost.Busca}" update="resultado" />
</h:inputText>
<p:ajaxStatus style="width:16px;height:16px;">
<f:facet name="start">
<h:graphicImage value="/ajaxloading.gif" style="width: 16px; height: 16px;" />
</f:facet>
<f:facet name="complete">
<h:outputText value="" />
</f:facet>
</p:ajaxStatus>
</h:panelGrid>
<h:panelGrid id="resultado">
<p:dataGrid id="listaArquivos" var="arq" value="#{buscaPost.listArquivos}" columns="2" >
<p:column>
<p:panel style="width: 100%;">
<h:panelGrid columns="2" style="text-align: left;">
<p:graphicImage value="#{arq.urlImage}" style="width: 120px; height: 120px;"/>
<h:panelGrid>
<h:outputLabel value="#{arq.nome}" style="font-weight: bold; font-size: 12px; color: red;"/>
<h:outputText value="#{arq.dataPost}" style="font-weight: bold;"/>
<h:outputLink value="http://www.guerapa.com/paginas/#{arq.urlArquivo}.html" target="_blank" style="font-size: 20px;">Mais info</h:outputLink>
</h:panelGrid>
</h:panelGrid>
</p:panel>
</p:column>
</p:dataGrid>
</h:panelGrid>
</td>
</tr>
</table>
</ui:fragment>[/code]
componente funcionando na pagina downloads.xhtml que foi carregada
[img=http://img31.imageshack.us/img31/589/workia.th.jpg]
image do componente que nao funciona desprotetor.xhtml
[img=http://img845.imageshack.us/img845/4864/dontwork.th.jpg]
Help plss