• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setting scroll position to a particular row of primefaces datatable

 
Ranch Hand
Posts: 32
Hibernate Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
   I have a data table with thousands of data. i have a search functionality. if I search a term, the row which contains the term has to be highlighted and scroll position should be on the row. it is working fine. but it takes too much of time to position the scrollbar. this leads to performance issue. can anyone help to fix this.

currently i have set style class to the match row. searching for the style class and calculating the position and setting it with jQuery.


is there any other way?
thanks in advance.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You really shouldn't attempt to display thousands of rows of data on a single web page. It's injurious to the eyes and sanity of the user. Plus, downloading all that data will give terrible performance, even if you scroll the display. It's far better to pre-filter the display to some reasonable size.

That's just general advice and not JSF-specific. One way to improve performance in JSF is to realize that the UI Model object (the DataTable) doesn't actually have to be an ORM Persistence Model object. It can just as easily be made from selected items instead of the entire query result. Or, for that matter, you can refine your query to return only items of immediate interest.

PrimeFaces can handle scrolling of DataModels without hard-coded JavaScript.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic