NPE in p:column sortBy. Version 1.0.0

UI Components for JSF
Post Reply
User avatar
mndot_lance
Posts: 137
Joined: 15 Oct 2009, 21:53

05 Mar 2010, 19:15

I created the issue in the issue tracker here:
http://code.google.com/p/primefaces/iss ... &start=100

code:

Code: Select all

<p:dataTable  var="relationship" value="#{parentHandler.allElementsInBundleSorted}" 
					style="width:925px;overflow:scroll;"
					paginator="true" 
					rows="15" 
					dynamic="true">

<p:column sortBy="#{relationship.primeElement.elementId}">
						<f:facet name="header">
							<h:outputText value="PR ID" />
						</f:facet>
						#{relationship.primeElement.elementId}
					</p:column>	

</p:dataTable>
In my data model, sometimes the relationship.primeElement will return null. Primefaces code should catch this NPE and continue sorting as if elementId is null.

User avatar
mndot_lance
Posts: 137
Joined: 15 Oct 2009, 21:53

05 Mar 2010, 19:16

There seems to be two parts to this - not only can none of the getter methods in the chain return null, but neither can the last getter. The actual value finally returned cannot be null either, or a NPE results.

Code: Select all

Caused by: java.lang.NullPointerException
17:47:35,235 ERROR [STDERR] 	at org.primefaces.model.BeanPropertyComparator.compare(BeanPropertyComparator.java:65)
17:47:35,235 ERROR [STDERR] 	... 49 more

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Mar 2010, 14:38

This is a known issue, I remember a similar issue in tracker, this should be fixed in upcoming release. Thanks Lance.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 10 guests