as you can see I have an nested dataTable inside it. and both have a button that redirect to another page with the details. for this I'm using rowExpansion. Now, the button outside the rowExpansion works fine, but inside the rowExpansion, only the first row works, the others sometimes work,but most the time, they give a NullPointerException on doFilter .below is a screenshot of the error.
Page code:
Code: Select all
<p:dataTable emptyMessage="Nenhuma Oportunidade Disponível"
style="width:850px;text-align:center;" paginator="true" id="op"
value="#{oport.lista2}" var="vaga"
rowKey="#{vaga.nm_oportunidade}" rows="20">
<p:column style="width:32px">
<p:rowToggler />
</p:column>
<p:column filterBy="#{vaga.nm_oportunidade}"
filterMatchMode="contains" sortBy="#{vaga.nm_oportunidade}">
<f:facet name="header">
Oportunidade
</f:facet>
<h:outputText value="#{vaga.nm_oportunidade}" />
<p:spacer height="10" />
</p:column>
<p:column filterBy="#{vaga.tp_oportunidade}"
sortBy="#{vaga.tp_oportunidade}">
<f:facet name="header">
Tipo
</f:facet>
<h:outputLabel value="#{vaga.tp_oportunidade}"></h:outputLabel>
</p:column>
<p:column filterBy="#{vaga.end.cidade.estado.nm_estado}"
filterMatchMode="contains"
sortBy="#{vaga.end.cidade.estado.nm_estado}">
<f:facet name="header">
Estado
</f:facet>
<h:outputLabel value="#{vaga.end.cidade.estado.nm_estado}"></h:outputLabel>
</p:column>
<p:column filterBy="#{vaga.end.cidade.nm_cidade}"
filterMatchMode="contains" sortBy="#{vaga.end.cidade.nm_cidade}">
<f:facet name="header">
Cidade
</f:facet>
<h:outputLabel value="#{vaga.end.cidade.nm_cidade}"></h:outputLabel>
</p:column>
<p:column filterBy="#{vaga.dt_inclusao.time}"
sortBy="#{vaga.dt_inclusao.time}">
<f:facet name="header">
Dt. de Inclusão
</f:facet>
<h:outputLabel value="#{vaga.dt_inclusao.time}">
<f:convertDateTime locale="pt_BR" pattern="dd/MM/yyyy"></f:convertDateTime>
</h:outputLabel>
</p:column>
<p:column>
<h:panelGrid columns="3" styleClass="actions" cellpadding="2">
<p:commandButton ajax="false"
action="#{oport.exibirDetalhesEmpresa}"
image="ui-icon ui-icon-search" title="Visualizar">
<f:setPropertyActionListener target="#{oport.emp}"
value="#{vaga}" />
</p:commandButton>
<p:commandButton action="#{oport.redir_atualizar}" ajax="false"
image="ui-icon ui-icon-pencil" title="Alterar">
<f:setPropertyActionListener target="#{oport.emp}"
value="#{vaga}" />
</p:commandButton>
<p:commandButton onclick="conf.show()"
image="ui-icon ui-icon-close" title="Excluir">
<f:setPropertyActionListener target="#{oport.emp}"
value="#{vaga}" />
</p:commandButton>
</h:panelGrid>
</p:column>
<!-- Dados do Curriculo -->
<p:rowExpansion id="row">
<p:dataTable emptyMessage="Nenhum Curriculo Disponível"
style="width:850px;text-align:center;" id="curri"
value="#{vaga.curriculos}" var="curri">
<p:column filterBy="#{curri.usuario.nm_pessoa}"
sortBy="#{curri.usuario.nm_pessoa}">
<f:facet name="header">
Candidato
</f:facet>
<h:outputText value="#{curri.usuario.nm_pessoa}"
/>
<p:spacer height="10" />
</p:column>
<p:column filterBy="#{curri.usuario.sexo}"
sortBy="#{curri.usuario.sexo}">
<f:facet name="header">
Sexo
</f:facet>
<h:outputLabel value="#{curri.usuario.sexo}"></h:outputLabel>
</p:column>
<p:column filterBy="#{curri.usuario.nascimento}"
sortBy="#{curri.usuario.nascimento}">
<f:facet name="header">
Idade
</f:facet>
<h:outputLabel value="#{curri.usuario.nascimento}"></h:outputLabel>
</p:column>
<p:column filterBy="#{curri.usuario.endereco.cidade.nm_cidade}"
sortBy="#{curri.usuario.endereco.cidade.nm_cidade}">
<f:facet name="header">
Cidade
</f:facet>
<h:outputLabel
value="#{curri.usuario.endereco.cidade.nm_cidade}"></h:outputLabel>
</p:column>
<p:column
filterBy="#{curri.usuario.endereco.cidade.estado.sg_estado}"
sortBy="#{curri.usuario.endereco.cidade.estado.sg_estado}">
<f:facet name="header">
Estado
</f:facet>
<h:outputLabel
value="#{curri.usuario.endereco.cidade.estado.sg_estado}"></h:outputLabel>
</p:column>
<p:column>
<h:panelGrid columns="3" styleClass="actions" cellpadding="2">
<p:commandButton ajax="false"
action="#{curriculo.exibeCurriculo}"
image="ui-icon ui-icon-search" title="Visualizar">
<f:setPropertyActionListener target="#{curriculo.curriculo}"
value="#{curri}" />
</p:commandButton>
</h:panelGrid>
</p:column>
</p:dataTable>
</p:rowExpansion>
</p:dataTable>
Also, I must tell you that is not the data because the same data in the first rowExpansion that there does not gives me any problem, gives the above error when acessed in any other line.
Now I'm using Primefaces 3.0.RC1,Tomcat 7 , and JSTL libs.this works on Primefaces 2.2.1, but my project is heavily based on Primefaces 3, so changing is not an option...