Forums Register Login

B&S: Data not refreshing after updating

+Pie Number of slices to send: Send
Hi
I am working on B&S.
I booked the record and its updated in file but it not dislapay in JTable after reading file.

Can anyone know the solution

Thanks in advace

Vaishali
+Pie Number of slices to send: Send
I was thinking about this too, and come to 2 solutions.
1. repeat the last search
2. if there was no error while calling book(), update the table "blindly"
+Pie Number of slices to send: Send
Hi

I am also doing same things then also its not displaying updated record

Following is my code:

controller.update(recordNo,records);
tableHandle = controller.find(criteria);
addDataInTable();



Code in update method

ArrayConvertIntoString writeRecord = new ArrayConvertIntoString();
int i=0;
while(i<ContractorInfo.totalField){
writeRecord.write(data[i], ContractorInfo.lenghtOfField[i]);
i++;
}
synchronized (database) {
database.seek(ContractorInfo.offset
+ recordNo* ContractorInfo.totalLength
+ ContractorInfo.flagValue);
database.write(recordValue.toString().getBytes());
}

Anyone have any solustion for file refresh?

Thanks

Vaishali
[ August 28, 2007: Message edited by: Vaishali Paramane ]
+Pie Number of slices to send: Send
Could it be as simple as not calling fireTableDataChanged() on the underlying table model?

Sagar
[ August 28, 2007: Message edited by: Sagar Salapaka ]
+Pie Number of slices to send: Send
 

Originally posted by Sagar Salapaka:
Could it be as simple as not calling fireTableDataChanged() on the underlying table model?

Sagar

[ August 28, 2007: Message edited by: Sagar Salapaka ]



:-), looks like you are right,.. I didn't read the question carefully.
+Pie Number of slices to send: Send
 

Originally posted by Sagar Salapaka:
Could it be as simple as not calling fireTableDataChanged() on the underlying table model?

Sagar

[ August 28, 2007: Message edited by: Sagar Salapaka ]



Hi sagar
thanks for replying. but I didnot get you what you means.
I didnot impliment fireTableDataChanged() method.

Please can you explain it.

again thanks

Vaishali
+Pie Number of slices to send: Send
Yo don't have to, it's already implemented in AbstractTableModel. When you update your model, just call this method and view will redraw.

http://java.sun.com/javase/6/docs/api/javax/swing/table/AbstractTableModel.html#fireTableDataChanged()
[ August 28, 2007: Message edited by: John Stone ]
+Pie Number of slices to send: Send
HI
I fired fireTableDataChanged on my tableHadler class

public class TableHandle extends AbstractTableModel{
}

then also my JTable doesnot showing updated record.

Please can anyone help me.

Thanks

Vaishali
+Pie Number of slices to send: Send
Hello Vaishali,

You may need to call repaint() on your JTable.

Jar
+Pie Number of slices to send: Send
It should repaint after fireTableDataChanged() is called.
Are you creating more than one JTable? I remember, that one rancher had similiar problem, because he created more than one JTable and they were stacked one on another.

Are the Sun tutorials on JTable working ok?
+Pie Number of slices to send: Send
Thanks

My problem solved.

Actually its giving exception thats why behind the code doesn't working.

Thanks again for help

Vaishali
[ September 06, 2007: Message edited by: Vaishali Paramane ]
rubbery bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 641 times.
Similar Threads
I want to merge the two files into one of kind: by placing englishKeyword=English in format Russian
Java-4b Please
a question about File class(urgent)
System.out.print(s + (b ? "T" : "F"));
how to read a line and store the data!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 18, 2024 22:35:28.