• Post Reply Bookmark Topic Watch Topic
  • New Topic

Some RowSet Info not Being Displayed

 
Oli Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I am reading from a database(SQL Server 2012) and storing that information in a ResultSet. I am then trying to display that information using a DataTable. The problem is, only some of the information is being displayed and I can't figure out why.

Here is my managed bean

And this is my JSF code


Any ideas? The ID and the commandLinks are being displayed but the Client is not.
Edit: I don't have a lot of experience with JSF so any tips are welcome
 
Tim Holloway
Bartender
Posts: 18412
58
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are doing a database fetch operation in a property-fetch method. The "get" and "set" methods can be invoked as many as 5 or 6 times in a SINGLE page request. That's a lot of overhead. Furthermore, if your get/set methods change the data state, then they won't operate reliably.

You should fetch the data once, cache it in a list or array, and return the cached data on subsequent "get" requests.
 
Oli Brown
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Tim. That's fixed the problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!