This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes JSF and the fly likes Primefaces datatable only show last item Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Primefaces datatable only show last item" Watch "Primefaces datatable only show last item" New topic
Author

Primefaces datatable only show last item

Enrique Villamizar
Ranch Hand

Joined: Jul 30, 2005
Posts: 93
Hi to everyone:

I´m taking my first steps on PrimeFaces. I'm running a dataTable but the page only shows the last item of a list and I have no idea what I'm missing.

NetBeans 6.9
JSF 2.0
Apache Tomcat 6.0
JDK 1.6
primefaces-2.2.M1.jar

My *.xhtml page:


My Bean:



The first problem is the folloing line:


Throws an error: javax.el.ELException: "fn:length" Not Found

When I delete the the page is showed but it prints only the last item of the car list.




B Nirvan
Ranch Hand

Joined: Oct 20, 2010
Posts: 82
You car list contains only one element as you are using the same Car object. Instantiate Car object in for loop instead. And for number of your cars, use #{tableBean.carsSmall.length}.

regards,
Nirvan.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Primefaces datatable only show last item
 
Similar Threads
Submit dataTable fields
Issues with scope: JSF-Primefaces
Datatable with column checkbox - Row Select
Primefaces datatable var attribute not working
Sorting is not working in my JSF PrimeFaces Datatable and blank (empty) rows are displayed filtering