DataTable problem

UI Components for JSF
Post Reply
_lucas_
Posts: 10
Joined: 09 Jul 2011, 22:42

09 Oct 2011, 01:41

hi, I have the following dataTable:
Image
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.
Image

Page code:

Code: Select all

	<p:dataTable emptyMessage="Nenhuma Oportunidade Dispon&iacute;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&atilde;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&iacute;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>
You may notice a custom filter i created "FiltroAcesso" on the error log above, but i tell you its not it, because I tried to remove it from my web.xml, but the problem continues.
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...

_lucas_
Posts: 10
Joined: 09 Jul 2011, 22:42

10 Oct 2011, 05:09

apparently if I limit the datatable to one row per page, it gives me no problem, but what good is a datatable if I can't show more than a result at once?

_lucas_
Posts: 10
Joined: 09 Jul 2011, 22:42

13 Oct 2011, 01:48

so, if no one has an answer , should I send a ticket, or this is probably some misconfiguration on my part?

justus
Posts: 48
Joined: 30 Dec 2011, 16:37

03 May 2012, 23:14

I got the same freakin issue.

The null pointer comes up when I expand the row. It doesn't happen if I use hardcoded static values.
3.3.1
WebSphere 7
Mojarra 2.0.4

From another forum member:
I've just fixed the problem on IE7...
I personally hate IE7 with all my heart but still need to support it for some time.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 60 guests