Referring to the example in the Javadoc for method "com.smartgwt.client.data.DataSource.updateCaches(DSResponse)", it provides an example using the DS.copyRecord(Record...).
However, my findings show that if you use the copyRecord to copy a ListGridRecord and use the copied record for dsResponse.setData(record) as indicated by the example, you see the following error in the Development Mode console.
If a ListGridRecord is being passed into the copyRecord, should a ListGridRecord be passed back?
Thanks
SmartClient Version: v9.1p_2014-05-19/Pro Deployment (built 2014-05-19)
Code:
// updatedRecord is the record we want to update Record record = supplyItemDS.copyRecord(updatedRecord); record.setAttribute("unitCost", 500); DSResponse dsResponse = new DSResponse(); dsResponse.setData(record); dsResponse.setOperationType(DSOperationType.UPDATE); supplyItemDS.updateCaches(dsResponse);
Code:
20:32:25.015 [ERROR] [xxx] 20:32:25.011:XRP9:WARN:Log:setData(): DSResponse data is expected to be an array of ListGridRecords. This allows the data to be displayed as expected in ListGrids bound to this dataSource. com.smartgwt.client.core.JsObject$SGWT_WARN: 20:32:25.011:XRP9:WARN:Log:setData(): DSResponse data is expected to be an array of ListGridRecords. This allows the data to be displayed as expected in ListGrids bound to this dataSource.
Thanks
SmartClient Version: v9.1p_2014-05-19/Pro Deployment (built 2014-05-19)
Comment