-
Enhancement
-
Resolution: Won't Fix
-
P4
-
None
-
1.4.2
-
x86
-
windows_xp
A DESCRIPTION OF THE REQUEST :
Besides TableSort, I am also using TableFilter to filter some record for display. The TableModelHandler embedded in TableSorter handle tableChanged(TableModelEvent e) by fireTableChanged(e) if the table is not sorting. However, in my case, the value change will make some records to be filter out, and thus, table structure changed. The current handling can't handle this case. I have added the following code to my TableSorter to solve the problem:
if (tableModel instanceof TableFilter) {
fireTableDataChanged();
} else {
fireTableChanged(e);
}
JUSTIFICATION :
In table filter case, this is needed.
CUSTOMER SUBMITTED WORKAROUND :
private class TableModelHandler implements TableModelListener {
public void tableChanged(TableModelEvent e) {
// If we're not sorting by anything, just pass the event along.
if (!isSorting()) {
clearSortingState();
// after using TableFilter, the filter table will have structure change
// instead of simply cell value change, therefore use fireTableDataChanged()
//fireTableChanged(e);
if (tableModel instanceof TableFilter) {
fireTableDataChanged();
} else {
fireTableChanged(e);
}
return;
}
Besides TableSort, I am also using TableFilter to filter some record for display. The TableModelHandler embedded in TableSorter handle tableChanged(TableModelEvent e) by fireTableChanged(e) if the table is not sorting. However, in my case, the value change will make some records to be filter out, and thus, table structure changed. The current handling can't handle this case. I have added the following code to my TableSorter to solve the problem:
if (tableModel instanceof TableFilter) {
fireTableDataChanged();
} else {
fireTableChanged(e);
}
JUSTIFICATION :
In table filter case, this is needed.
CUSTOMER SUBMITTED WORKAROUND :
private class TableModelHandler implements TableModelListener {
public void tableChanged(TableModelEvent e) {
// If we're not sorting by anything, just pass the event along.
if (!isSorting()) {
clearSortingState();
// after using TableFilter, the filter table will have structure change
// instead of simply cell value change, therefore use fireTableDataChanged()
//fireTableChanged(e);
if (tableModel instanceof TableFilter) {
fireTableDataChanged();
} else {
fireTableChanged(e);
}
return;
}