Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "dataTable and repeatitive data" Watch "dataTable and repeatitive data" New topic

dataTable and repeatitive data

shilan kalhor

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


is it something wrong with dataTable or something?

thanks in advance
Stefan Evans

Joined: Jul 06, 2005
Posts: 1274
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:

Have you tried LearnNowOnline?
subject: dataTable and repeatitive data