| Summary: | updateTable does not clear fields that are empty now | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Matthias Zimmermann <zimmermann> |
| Component: | Scout | Assignee: | Project Inbox <scout.core-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | ||
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
fixed on 16.3.2011, #97852 shipped with eclipse scout 3.7.0 |
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.