ListGrid Cell Update Makes Foreign Cells Go Blank?

I have a ListGrid, set to a DataSource:

DataSource requests = DataSource.get("REQUESTS");

ListGrid listGrid = new ListGrid();
listGrid.setDataSource(requests);

The DataSource references some foreign tables/fields, e.g.,

<field name="NAME" tableName="EMPLOYEE"></field>

So far so good, the ListGrid populates columns with data from both the native “requests” DS and the referenced foreign “employee” DS.

I have an “approve” button with an action to do a SQL UPDATE for the native requests.STATUS field in the currently selected ListGrid records:

for (i...
selectedRecords[i].setAttribute("STATUS", "approved");
listGrid.updateData(selectedRecords[i]);

The issue:

When viewing the ListGrid during the update, the “STATUS” field in the record(s) is updated as expected with the desired AJAX slickness. However, for the records that have been updated, the ListGridField cells that get their data from the foreign employee.NAME go blank.

If I force a refresh of the ListGrid either by browser F5 or

listGrid.invalidateCache();

…the NAME cells again display their values.

But this loses the desired AJAX “no-refresh” behavior. I’d like the employee.NAME cell data to remain in view like the other requests.* fields.

How best to approach this?

This means that the record being returned by your update operation lacks fields that were present in the record being returned the fetch operation. See operationBinding.cacheSyncOperation.

Wow.

This fixed the issue, and also opened my eyes to the concept of transaction chaining.

I had been writing separate CRUD operations w/ callbacks, sometimes nested. Now I see that I can start with a single operation, then chain the rest? I’ll give it a shot.

Thanks!