When you pass a record created by "new Record()" to updateData(), that's still an update, not an add.
Announcement
Collapse
No announcement yet.
X
-
I understand now. Makes sense. That solved half of the problem. Using the new code below, only the updated field is being reported. Gr8.
Code:... for (ListGridRecord row : listGrid.getRecords()) { if (Integer.parseInt( row.getAttribute(DISPLAY_ORDER)) != i) { Record newRow = new Record(); newRow.setAttribute(ID, row.getAttribute(ID)); newRow.setAttribute(DISPLAY_ORDER, i); listGrid.updateData(newRow); } i++; } ...
Comment
-
Any save operation automatically initiated by a component, including for example ListGrid saves due to canEdit:true, or form saves due to saveData(), will include the old values.
Here, you are bypassing all components and going directly to DataSource-level APIs, you need to do what the component does automatically in these other cases, and provide the existing Record as dsRequest.oldValues.
Note this is also true of ListGrid.updateData() because it's just a pass-through to the DataSource API - it has no context about what record is being updated or whether it's even present in the browser.
Comment
Comment