Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Updating a record in a DataSource doesn't send the old values

    When I update a record in my data source, I don't get to see the old values of the record on the server.

    This is my code on the client:
    Code:
    Record newRecord = new Record(oldRecord.toMap()); // make a copy
    newRecord.setAttribute("attribute", "new value");
    myDataSource.updateData(newRecord);
    This is my code on the server:
    Code:
    class MyDataSource extends BasicDataSource {
        /* ... stuff ... */
        public DSResponse executeUpdate(DSRequest req) throws Exception {
            final Map oldValues = req.getOldValues();
            final Map newValues = req.getValues();
            /* ... more stuff ... */
        }
    }
    oldValues and newValues always contain the same thing. What's up with that? Shouldn't I see the old values in DSRequest.getOldValues()?

    I'm using a nightly SmartGWT 2.5.
Working...
X