DataTable with Filter while submitting , a NPE thrown

UI Components for JSF
Post Reply
Ganga
Posts: 10
Joined: 21 Jan 2011, 08:07

29 Apr 2011, 13:10

Hi,
My project is build on Spring WebFlow 2.3.0, JSF 2.0.4 & Primefaces 3.M1
In the Form I have a " DataTable " primefaces component, which is lazily loaded and has "filterBy" attribute is enabled, and i have a JSF's Commmand button in the Form , on Click which does make a transition to another screen.

But, on Click of a command Button there is a NullPointerException in DataHelper class

//Metadata for callback
if(table.isPaginator()) {
RequestContext.getCurrentInstance().addCallbackParam("totalRecords", table.getRowCount());
}

Here RequestContext.getCurrentInstance() object returns a null Object, from My understanding the "RequestContext.getCurrentInstance()" return the RequestContext object only when the request is a ajax
and more over the command button is not a ajax request.

And the stack trace is

Caused by: java.lang.NullPointerException
at org.primefaces.component.datatable.DataHelper.decodeFilters(DataHelper.java:128)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:47)
at javax.faces.component.UIComponentBase.decode(UIComponentBase.java:795)
at javax.faces.component.UIData.processDecodes(UIData.java:984)
at org.primefaces.component.datatable.DataTable.processDecodes(DataTable.java:595)
at javax.faces.component.UIForm.processDecodes(UIForm.java:216)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1047)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1047)
at javax.faces.component.UIComponentBase.processDecodes(UIComponentBase.java:1047)
at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:926)
at org.springframework.faces.webflow.FlowLifecycle.invokePhase(FlowLifecycle.java:118)
at org.springframework.faces.webflow.FlowLifecycle.execute(FlowLifecycle.java:70)
at org.springframework.faces.webflow.JsfView.processUserEvent(JsfView.java:121)
at org.springframework.webflow.engine.ViewState.handleEvent(ViewState.java:226)

So, How can I handle this issue, even though I tried the option "immediate" in the command button, but still its a same issue.

Thanks in advance.

domgom
Posts: 16
Joined: 09 Apr 2011, 12:25

29 Apr 2011, 19:33

I have a problem related about this:
I tried to put a p:fileDownload into a dataTable and because of ajax="false" of the commandLink it simply doesn't work (works fine outside the datatable). If I set ajax="true" (which is incorrect) I obtain the same nullpointerexception than you.
I think I have to make a dialog with the download button in there.. very dissapointing :cry:
Tomcat 6.0
Mojarra 2.0.2-FCS

lucascarlessi
Posts: 2
Joined: 25 Mar 2011, 22:21

02 May 2011, 20:35

Same problem here, occurs only when a button ajax="false" is inside the table and only in the 3.0M1.

scar
Posts: 15
Joined: 28 Apr 2011, 16:06

03 May 2011, 12:24

hi!

same problem here too...
i'm using 3.0.M1 and a commandButton in a filtered dataTable with ajax="false"

best regards

persapiens
Posts: 17
Joined: 02 Sep 2010, 17:27

12 May 2011, 13:01

+1

i'm using 3.0.M1 and a commandLink with ajax="false" in a dataTable

best regards
primefaces 3.3.1, mojarra 2.1.7, tomcat 7.0.27, java sun 1.6.0_24, netbeans 7.1.1

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

12 May 2011, 13:22

Please create an issue ticket if you're sure there is a problem. Filtering impl is changed in 3.0.M1 so this might be a bug.

User avatar
pedrodombrowski
Posts: 9
Joined: 04 Nov 2010, 21:21
Location: Brasil - RS - Canela

18 May 2011, 15:35

Hi im having the same problem, but, on my app any CommandButton or CommandLinks on the page generates a NPE, even outside the dataTable.
PrimeFaces 3.5, JSF 2.0, JPA, EJB, JBoss 7.1.1 Final Brontes, Postgresql 9.2, Eclipse Juno - Java EE


erdemoo
Posts: 5
Joined: 10 Jul 2011, 13:55

10 Jul 2011, 14:08

Hey I am new to primefaces and not much familiar with its code, but this problem seems to be existing in lazy datatables.

I use 3.0.M3-SNAPSHOT, myfaces 2.1.0 and tomcat as my environment.

When I use filter with lazy datatables, a commandlink in the datatable results in NPE.

Caused by: java.lang.NullPointerException
at org.primefaces.component.datatable.DataHelper.decodeFilters(DataHelper.java:146)
at org.primefaces.component.datatable.DataTableRenderer.decode(DataTableRenderer.java:51)


erdem

sugree
Posts: 15
Joined: 10 Jul 2011, 16:38

11 Jul 2011, 15:56

We seem to encounter the same situation.

http://primefaces.prime.com.tr/forum/vi ... =3&t=13546

Probably we should create new issue.
PrimeFaces 3.0.M2 / 3.0.M3-SNAPSHOT, Spring Web Flow 2.3.0.RELEASE, Mojarra 2.0.4-b09, Jetty 6, Tomcat 6

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 21 guests