aspose 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
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: 1018
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: dataTable and repeatitive data