• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populate Jtable on client Load?

 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
When "loading" the client for the first time, does anyone automatically fill the jtable or are people displaying a blank jtable and waiting for the user to run a criteriafind(x)?
Thanks
Joe
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should display the table with all results on start up.
 
Doug Melzer
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I second that opinion.
 
Emerson Dunne
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What if your database had thousands of rows? Do you really want to fetch all that information from your database, serialize all those objects, transmit all that data, and display all those rows in your JTable when the user hasn't even indicated they want to see anything?
I think its better to wait until the user actually makes a search request.
 
Aleksey Matiychenko
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We are dealing with the sample application with 26 rows.
But you are right in a real world you might not want to do that.
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the best way to display all records?
Do a criteriafind with "any" "any"
or
get a record count then loop and call getRecord(x)?
Cheers
Joe
 
Conor Allen
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Presumably each call to getRecord() would result in a networked call - therefore I'd go with criteriaFind() - not sure that I'd do that on startup though
Regards
Conor
 
J Hartley
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm, i think i might put a new method in the Data class that synchronises the Data object and returns an array of DataInfo. This array would contain ALL rows.
My loop in the client cant be a good idea, what if someone deletes all the records just after i have got the record count, all sorts of crazy problems

Joe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic