• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Displaying Search Results

 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys:
I think I've got a reasonable fully functioning prototype, but now I'm trying to go back and improve my design and algorithms. One thing that I'm not the least bit happy with is how I display my search results. When a search is done I call criteriaFind and it returns DataInfo[] as you know, so then I have another class I call TableModelFilter (but it's actually kind of the OPPOSITE of a filter) that I stick that data into. Then, in my TableModel, whenever data is requested, I look atthe filter and if there is data in the filter, I use that. It WORKS, but I am not happy with this. It's not the least bit elegant. Does anyone have any suggestions. You don't have to give any specifics, just, if you like, a gentle suggestion.
Thanks.
With Respect,
Matt
 
Adrian Yan
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My prototype simply refresh the JTable after the search.
 
joey phillip
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using AbstractTableModel and for every search i am calling
Jtable's setModel() method with new search result data.

joey
 
Matt DeLacey
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys, thanks for responding. But do you have a data structure inside your TableModel that holds the data in memory. From TableModel I was grabbing data directly from the database upon each refresh, or if a search has been conducted, I grabbed it from my Filter class, which basically has an internal data structure to hold the data. I guess I could just eliminate the middle man and have the data structure inside the TableModel and then after each search refresh the data in the TableModel. It just seems like the info presented to the user could be VERY stale that way. The only time they get updated dat is when they do a search. I realize the specs say you don't have to refresh all clients everytime data in the database is altered, but it seems like maybe that's somewhat different from keeping such potentially stale data visible to the user. Maybe it's not. I'll have to think about this. Thanks.
With Respect,
Matt DeLacey
 
Anil Sadineni
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai Guys,
I am using a function named "void refreshWithNewData(String [])" for refreshing the data in JTable's TableModel. After getting the information from criteriaFind(), I am calling above method after that I am simply calling repaint() method on JTable.
Any Comments,
with regards
Anil.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic