Pessoal,
Tenho a seguinte pagina:
<?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: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">
<ui:composition template="/template.xhtml">
<ui:define name="title">
<h:outputText value="#{bundle.ListEquipamentosTitle}"></h:outputText>
</ui:define>
<ui:define name="body">
<h:form styleClass="jsfcrud_list_form">
<h:panelGroup id="messagePanel" layout="block">
<h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
</h:panelGroup>
<h:panelGroup>
<p:dataTable id="dataTable" value="#{equipamentosCriteriaBean.consultaCodigo}" var="item"
paginator="true" rows="10"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
rowsPerPageTemplate="5,10,20,30">
<f:facet name="header">
<h:outputText value="#{bundle.ListUsuariosTitle}"></h:outputText>
</f:facet>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_codigo}"/>
</f:facet>
<h:outputText value="#{item.codigo}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_subestacao}"/>
</f:facet>
<h:outputText value="#{item.subestacao}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_alimentador}"/>
</f:facet>
<h:outputText value="#{item.alimentador}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_distancia}"/>
</f:facet>
<h:outputText value="#{item.distancia}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_preventiva}"/>
</f:facet>
<h:outputText value="#{item.preventiva}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_ultimaInspecao}"/>
</f:facet>
<h:outputText value="#{item.ultimaInspecao}">
<f:convertDateTime pattern="dd/MM/yyyy"/>
</h:outputText>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_statusEquipamento}"/>
</f:facet>
<h:outputText value="#{item.statusEquipamento}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_tipoeq}"/>
</f:facet>
<h:outputText value="#{item.tipoeq.nome} / #{item.tipoeq.fabricante}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_regional}"/>
</f:facet>
<h:outputText value="#{item.regional.nome}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_empresa}"/>
</f:facet>
<h:outputText value="#{item.empresa.nome}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value="#{bundle.ListEquipamentosTitle_comunicacao}"/>
</f:facet>
<h:outputText value="#{item.comunicacao.descricao} / #{item.comunicacao.codMeio.descricao}"/>
</p:column>
<p:column>
<f:facet name="header">
<h:outputText value=" "/>
</f:facet>
<h:commandLink action="#{equipamentosController.prepareView}" value="#{bundle.ListEquipamentosViewLink}"/>
<h:outputText value=" "/>
<h:commandLink action="#{equipamentosController.prepareEdit}" value="#{bundle.ListEquipamentosEditLink}"/>
<h:outputText value=" "/>
<h:commandLink action="#{equipamentosController.destroy}" value="#{bundle.ListEquipamentosDestroyLink}"/>
</p:column>
</p:dataTable>
</h:panelGroup>
<h:panelGrid columns="2">
<p:panel header="Export All Data">
<h:commandLink>
<p:graphicImage value="/images/excel.png" />
<p:dataExporter type="xls" target="dataTable" fileName="cars" />
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/pdf.png" />
<p:dataExporter type="pdf" target="dataTable" fileName="cars"/>
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/csv.png" />
<p:dataExporter type="csv" target="dataTable" fileName="cars" />
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/xml.png" />
<p:dataExporter type="xml" target="dataTable" fileName="cars" />
</h:commandLink>
</p:panel>
<p:panel header="Export Page Data">
<h:commandLink>
<p:graphicImage value="/images/excel.png" />
<p:dataExporter type="xls" target="dataTable" fileName="cars" pageOnly="true"/>
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/pdf.png" />
<p:dataExporter type="pdf" target="dataTable" fileName="cars" pageOnly="true"/>
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/csv.png" />
<p:dataExporter type="csv" target="dataTable" fileName="cars" pageOnly="true"/>
</h:commandLink>
<h:commandLink>
<p:graphicImage value="/images/xml.png" />
<p:dataExporter type="xml" target="dataTable" fileName="cars" pageOnly="true"/>
</h:commandLink>
</p:panel>
</h:panelGrid>
</h:form>
</ui:define>
</ui:composition>
</html>
Com o seguinte ManageBean:
public List<Equipamentos> ConsultaCodigo(){
return jpaController.findEquipamentosEntities("codigo", 101);
}
fiz esse metodo só para testes, pra depois passar os argumentos dinamicamente. O caso é que quando executo esta consulta a pagina simplismente não renderiza.
Alguém sabe porquê?
Sds,
Maurijava.