• Post Reply Bookmark Topic Watch Topic
  • New Topic

Primefaces Sorting not working properly with live scrolling  RSS feed

 
Raghu Sundar
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have datatable with live scrolling enabled.The columns are not getting sorted fully.When one of the columns is sorted,for example "insured" in the image shown below, all the records seem to have sorted but when i reach the end of scroll and next set of records get loaded i see other records in unsorted order as indicated in the image ,when i try to see the column in descending order.So because of this i am not getting the sorting feature accurately done(All records are not getting sorted at a single stretch)

Is it something which is happening due to live scrolling or can we have any work around for this.Please give solution for this as it is one of the important feature that needs to be incorporated in my work.



My JSF code snippet

 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you mean sorted ... a-z and A-Z sorting order is different in Java. So if you expect say "a" and "A" have the same sorting sequence then you may have to probably override the Primefaces sorting class.

Another way is to store the data in a consistent way eg start with all capital letters.
 
Raghu Sundar
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tsang,Thanks for your reply.Yes,as per your analysis the upper and lower case entries are being sorted separately.Also another thing that i got to know is when the next set of records are loaded on live scrolling they are in completely unsorted order.Is it something which is drawback with primefaces where sorting cannot be used with live scrolling.Do i need to completely override the sorting method to suite my requirement?
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rakshith Sridharamurthy wrote:Hi Tsang,Thanks for your reply.Yes,as per your analysis the upper and lower case entries are being sorted separately.Also another thing that i got to know is when the next set of records are loaded on live scrolling they are in completely unsorted order.Is it something which is drawback with primefaces where sorting cannot be used with live scrolling.Do i need to completely override the sorting method to suite my requirement?


Not sure if live scrolling has any side effects on sorting.

Another approach is NOT use (live) scrolling but pagination.
 
Raghu Sundar
Ranch Hand
Posts: 40
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My customer doesn't want pagination
 
java cody
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am facing the same problem wherein the sorting is not maintained when i am using Primefaces liveScroll . Once data is sorted and user scrolls and additional data is loaded via progressive loading then the new data that is loaded is not in sorted state . Did any one find a solution to this issue?
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Java Cody",

We don't have many rules here at the JavaRanch, but we do insist that you use your Real Name and not some sort of "handle" or obvious alias. If you're not sure about this, see
http://www.javaranch.com/name.jsp .
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!