Datatable not sorting

UI Components for JSF
Post Reply
primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 01:13

I just can't get sorting working. I'm not sure if this should be posted in the Rain forums, because I am just using PrimeFaces for the first time, and purchased/installed the Rain layout. So I'm not sure whether Rain is causing this or not.

I define a standard p:dataTable and use:

<p:column headerText="Name" field="name" filterMatchMode="contains" />

And sort does not work.

Here is my p:dataTable definition:

<p:dataTable id="table" widgetVar="table" stripedRows="true" reflow="true"
value="#{viewBean.dtos}"
var="dto" selection="#{viewBean.dtos}" rowKey="#{dto.id}" paginator="true"
rows="10" rowSelectMode="add">


My PrimeFaces version:

<!-- https://mvnrepository.com/artifact/org. ... primefaces -->
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>10.0.0-RC2</version>
</dependency>

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

22 Nov 2021, 11:16

try 11.0.0-RC2 instead of the old 10
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

Scot63
Posts: 1
Joined: 22 Nov 2021, 11:20

22 Nov 2021, 11:21

I could be missing something obvious but if sorting is done in the view why not remove the ->orderBy clause from your query in the controller?

Official website
Last edited by Scot63 on 24 Nov 2021, 12:18, edited 1 time in total.

primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 15:25

This breaks my rain layout that I just purchased.

Caused by: java.lang.NoSuchMethodError: org.primefaces.util.LangUtils.isNotEmpty(Ljava/lang/String;)Z
at org.primefaces.application.DialogKeepFlashPhaseListener.isInDialogPreparation(DialogKeepFlashPhaseListener.java:62)
at org.primefaces.application.DialogKeepFlashPhaseListener.beforePhase(DialogKeepFlashPhaseListener.java:47)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:77)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:259)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:206)

tandraschko
PrimeFaces Core Developer
Posts: 3979
Joined: 03 Dec 2010, 14:11
Location: Bavaria, DE
Contact:

22 Nov 2021, 15:30

looks like duplicate jars
Thomas Andraschko

PrimeFaces | PrimeFaces Extensions

Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE

Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko

primeUser99282
Posts: 36
Joined: 14 Nov 2021, 01:48

22 Nov 2021, 16:01

Yep, Eclipse needed to clean the server. Does this break anything in Rain layout that I may not be aware of?

jepsar
Posts: 166
Joined: 03 Sep 2014, 11:41
Location: NL / BE
Contact:

22 Nov 2021, 16:20

PrimeFaces will not break your theme. You might end up with some missing styling as new components are introduced in 11. As you are coming from 10, this will probably not be an issue for you.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub: https://github.com/jepsar
Spotify: 90s Rave, Acid, Trance, House

clintja
Posts: 1
Joined: 12 Feb 2020, 23:35

02 Aug 2022, 21:23

"Caused by: java.lang.NoSuchMethodError: org.primefaces.util.LangUtils.isNotEmpty(Ljava/lang/String;)Z
at org.primefaces.application.DialogKeepFlashPhaseListener.isInDialogPreparation(DialogKeepFlashPhaseListener.java:62)
at org.primefaces.application.DialogKeepFlashPhaseListener.beforePhase(DialogKeepFlashPhaseListener.java:47)
at org.apache.myfaces.lifecycle.PhaseListenerManager.informPhaseListenersBefore(PhaseListenerManager.java:77)
at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:259)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:206)"

Have this issue been rectified? I am having this very same problem with my paradise layout. i am trying to update my paradise layout to the latest as well as use use primefaces 11. Everything worked well when it was primefaces 10

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 51 guests