File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes dataTable and repeatitive data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable and repeatitive data" Watch "dataTable and repeatitive data" New topic
Author

dataTable and repeatitive data

shilan kalhor
Greenhorn

Joined: May 14, 2006
Posts: 1
hi all

i'm using jsf and datatable for displaying,deleting and editing result of a query
the problem is when i try to assign the value of the datatable to a Result Object, everything

goes right but as i try to assign a ArrayListDataModel or ListDataModel. it only displays the

last record of my table and it repeat it according to the table records count!
i'm really confused since i've printed the value of the model for different indexes and they are

different! but when it comes to display the data on the datatable, it shows the last record only

repeatedly

is it something wrong with dataTable or something?


thanks in advance
shilan
Stefan Evans
Bartender

Joined: Jul 06, 2005
Posts: 1016
Before pointing the finger at datatable, I would first question the validity of the List.
It is quite possible that the records in the List ARE all the same values.

There is a common error in coding, when looping through an adding items to a list - you need to create a new instance for every item in the list.
Incorrect code:


Correct code:



Cheers,
evnafets
 
Don't get me started about those stupid light bulbs.
 
subject: dataTable and repeatitive data
 
Similar Threads
can I let JSF datatable only display last one record ?
How to use datatable with no records in a list
Datatable problem
unit testing lock and unlock
Incrementing...