Olá, estou tentando chamar o dialog de dentro de um DataGrid, com os outros dados referentes ao meu objeto, porém o erro é este:
javax.servlet.ServletException: Cannot find component with identifier “enqueteDialog” referenced from “form:j_idt21:0:j_idt28”.
javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)
Já tentei usar o padrão dos dois ponto update=":detalheEnquete" e o erro persiste, nem o Bean é chamado.
Segue meu código:
<!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:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:comp="http://java.sun.com/jsf/composite/componentes"
xmlns:p="http://primefaces.org/ui">
<h:head>
<title>SCISPI - Sistema científico de enquetes e pesquisa</title>
</h:head>
<ui:composition template="_template.xhtml">
<ui:define name="corpo">
<p:dataGrid var="enquete" value="#{enqueteBean.enquetes}" columns="3"
rows="12" paginator="false"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}">
<div style="width: 400px; height: 100px" align="center">
<p:panel header="#{enquete.nome}" style="text-align:center">
<h:panelGrid columns="2" width="80%">
<h:outputText value="Area:" style="font-weight:bold" />
<h:outputText value="#{enquete.area}" />
<h:outputText value="Descrição:" style="font-weight:bold" />
<h:outputText value="#{enquete.descricao}" />
</h:panelGrid>
<p:commandLink update="detalheEnquete"
oncomplete="enqueteDialog.show()" title="Detalhes da Enquete">
<h:outputText styleClass="ui-icon ui-icon-search"
style="margin:0 auto;" />
<f:setPropertyActionListener value="#{enquete}"
target="#{tableBean.enqueteSelecionada}" />
</p:commandLink>
</p:panel>
</div>
</p:dataGrid>
<p:dialog header="Detalhes da Enquete" widgetVar="enqueteDialog"
modal="true">
<p:outputPanel id="detalheEnquete" style="text-align:center;"
layout="block">
<h:panelGrid columns="2" cellpadding="5">
<h:outputLabel for="dataInicial" value="Inicio: " />
<h:outputText id="dataInicial"
value="#{enquete.enqueteSelecionada.dataInicial}" />
<h:outputLabel for="dataFinal" value="Final: " />
<h:outputText id="dataFinal"
value="#{enquete.enqueteSelecionada.dataFinal}" />
<h:outputLabel for="descricao" value="Descrição: " />
<h:outputText id="descricao"
value="#{enquete.enqueteSelecionada.descricao}" />
</h:panelGrid>
</p:outputPanel>
</p:dialog>
</ui:define>
</ui:composition>
</html>
Obrigado