Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345538

Summary: updateTable does not clear fields that are empty now
Product: z_Archived Reporter: Matthias Zimmermann <zimmermann>
Component: ScoutAssignee: Project Inbox <scout.core-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matthias Zimmermann CLA 2011-05-12 03:37:32 EDT
Example: Table with one row, 10 columns, filled as follows:
InternalTableRow[0, Allgemein, Immatrikulation, 5, null, Firma, Firma/Privat, Firma, Firma, Firma]

New calling updateTable (in AbstractTable) with new data where only the first 7 columns contain a value (the other columns are null).

replaceRowsCase2 (in AbstractTable) will have the following situation:
oldRow = InternalTableRow[0, Allgemein, Immatrikulation, 5, null, Firma, Firma/Privat, Firma, Firma, Firma]
newRow = TableRow[0, 901010, 901011, 5, null, 901013, 901014]

Which will cause that only the first 7 columns will get updated, the others 3 won't and therefore still holding the old values.

Solution (one of them):
in replaceRowsCase2 (in AbstractTable)
Add an else to:
            for (int columnIndex = 0; columnIndex < getColumnCount(); columnIndex++) {
              if (columnIndex < newRow.getCellCount()) {
                oldRow.getCellForUpdate(columnIndex).updateFrom(newRow.getCell(columnIndex));
              }
            }
that will set the column value at index columnIndex to null.
Comment 1 Matthias Zimmermann CLA 2011-05-12 03:38:09 EDT
fixed on 16.3.2011, #97852
Comment 2 Matthias Zimmermann CLA 2011-06-28 08:42:31 EDT
shipped with eclipse scout 3.7.0