-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
19
-
generic
-
generic
A DESCRIPTION OF THE PROBLEM :
When table cell is being edited, firing table.tableChanged(new TableModelEvent(${tableModel})) (with first row = 0 and last row = Integer.MAX) leaves editor active.
If there are less rows in new data set than editor's target row, editor remains active but not visible. This is especially error-prone when editing bean properties 'name-value' model, where each value in column could have own class: class cast error ruins both commit and cancel.
In case editor target cell is affected by data change, it should be cancelled.
CUSTOMER SUBMITTED WORKAROUND :
JTable subclass with overriden 'tableChanged()':
@Override
public void tableChanged(TableModelEvent e){
// Cancel editing if target affected
if(this.editingRow >= 0 && this.editingRow >= e.getFirstRow() && this.editingRow <= e.getLastRow()){
this.removeEditor();
}
super.tableChanged(e);
}
FREQUENCY : always
When table cell is being edited, firing table.tableChanged(new TableModelEvent(${tableModel})) (with first row = 0 and last row = Integer.MAX) leaves editor active.
If there are less rows in new data set than editor's target row, editor remains active but not visible. This is especially error-prone when editing bean properties 'name-value' model, where each value in column could have own class: class cast error ruins both commit and cancel.
In case editor target cell is affected by data change, it should be cancelled.
CUSTOMER SUBMITTED WORKAROUND :
JTable subclass with overriden 'tableChanged()':
@Override
public void tableChanged(TableModelEvent e){
// Cancel editing if target affected
if(this.editingRow >= 0 && this.editingRow >= e.getFirstRow() && this.editingRow <= e.getLastRow()){
this.removeEditor();
}
super.tableChanged(e);
}
FREQUENCY : always