Hi, I've completed my GUI. As the application starts, I'm showing all the table data from the db.db file. Now, when I choose any flight and reserve seats on it, the display would'nt update even though I tried the following : dataBase.modify(freshRecord) ; // MODIFY THE DATABASE
flightDetailTable.tableChanged(new TableModelEventfbnServicesTableModel)) ; flightDetailTable.repaint() ; flightDetailTable.updateUI() ; Is there any way I can update the data on the GUI as soon as the reservation is done, instead of using the search button to refresh the data displayed. Any help is appreciated. Thanks, Ravi.
Thanks,<BR>Ravikiran<BR>rkchoppalli@yahoo.com
Paul Anilprem
Enthuware Software Support
Ranch Hand
Joined: Sep 23, 2000
Posts: 2547
posted
0
It is not clear how you've implemented your table model, but i am assuming it has a vector containing the rows that are being displayed by the table. Now, if you want to refresh the view, then first you have to refresh that vector...may be by executing the same criteriaFind on the server and getting the latest data. And then you should call fireTableDataChanged() or other such methods. HTH, Paul.
I could solve it. Actually I was not using Vector to store the values. If so, I could have used DefaultTableModel itself. But I was storing them as String[][] only as it is coming from DataInfo. My mistake was that I was not assigning the data[][] getting from criteriaFind to the localdata[][] of my CustomTableModel. Once I assigned that, the GUI is reflecting my changes.
BUT still, I have a problem. When I reserve the seat at that very moment my GUI is not getting updated. I had to do search again to see the changed data. Imagine this situation, there were some flights in the display. Now user searches some origin to destination combination for which flights does'nt exist, and the flights in display are not refreshed. Now, the origin and destination you see in the combo boxes are different from the flight being shown in the display. Is this acceptable or do we need to take care of this ? Thanks, Ravi.