Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345538 - updateTable does not clear fields that are empty now
Summary: updateTable does not clear fields that are empty now
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Scout (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-12 03:37 EDT by Matthias Zimmermann CLA
Modified: 2021-08-19 10:58 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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