MrExt
5 Jun 2009, 5:29 AM
Not initialing originalvalues of reused fields cause that future rows to not detecting changes (field dirty) when the new value is equal to the original of previous row editing.
publicvoid startEditing(int rowIndex, boolean doFocus) {
…
for (int i = 0, len = cm.getColumnCount(); i < len; i++) {
Field<Object> f = (Field<Object>) getItem(i);
String dIndex = cm.getDataIndex(i);
Object val = cm.getEditor(i).preProcessValue(record.get(dIndex));
f.setValue(val);
-> f.updateOriginalValue(val);
values.add(val);
}
…
}
publicvoid startEditing(int rowIndex, boolean doFocus) {
…
for (int i = 0, len = cm.getColumnCount(); i < len; i++) {
Field<Object> f = (Field<Object>) getItem(i);
String dIndex = cm.getDataIndex(i);
Object val = cm.getEditor(i).preProcessValue(record.get(dIndex));
f.setValue(val);
-> f.updateOriginalValue(val);
values.add(val);
}
…
}