• Post Reply Bookmark Topic Watch Topic
  • New Topic

Question in h:dataTable  RSS feed

 
Vamsi Polimetla
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi my question is,
i have data(ListDataModel), i want to disply that using h:dataTable, i want to show only first N rows of list. i can able to show all rows, but i want only first few rows.. is there any way that i can do this with h:dataTable or do i need to do in the backend ?

authors do you have any quick solution ?
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can page the data using something like MyFaces data scroller component. However, I would prefer to do this in the backend. Preferrably the query to the data itself. No need in wasting resources to return data you don't even need nor want.
 
Chris Schalk
author
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, Myfaces provides a good solution with its scroller component. In fact the book also shows how to incorporate a custom scroller component (based off of Sun's ref implementation demos) into a page with a dataTable. This is in chapter 9.

This brings up I think an important point for those new to Faces. It has been said that the core set of components that you get when you download say Sun's reference implementation are pretty basic - ie. they don't have all the fancy features you see in other Web frameworks.
Actually this is sort of true, but the intention of Spec components (Core & HTML) were meant mainly to serve as foundational specification components and let the Opensource community and vendors take it from there and build more sophisticated components that pick up where these "base" or spec components leave off.
This is exactly what we see now with MyFaces, ADF Faces, Web Galileo, Sun's Studio Creator components etc. If you try out these components, you'll see that they pack a lot of firepower in them. Future versions of these components are getting even more powerful with AJAX integration and so on..

Hope that helps..
-Chris
 
Vamsi Polimetla
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your comments, we are using J2EE RI, i did not see any pattern to get first few rows of data. i think new versions might have some

Thanks for your response
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!