DynamicForms and updateCaches

SmartClient Version: v13.1p_2026-09-16/Enterprise Deployment (built 2026-09-16)

Hi, while receiving RealTimeMessaging updates and calling updateCaches() with a DSResponse of operationType “update”, I noticed that a databound DynamicForm showing that record is updated as well.

I seemed to remember a different behavior, where forms weren’t updated to avoid overwriting values while a user might be editing them. This thread seemed to confirm that recollection:
https://forums.smartclient.com/forum/smart-gwt-technical-q-a/243285-dynamicform-acts-different-to-updated-data-than-listgrid-5-1p-bug?p=243293#post243293

However, I later found this thread:
https://forums.smartclient.com/forum/smart-gwt-technical-q-a/269906-form-has-explicitly-specified-value-for-field-s-text1-but-has-no-item-associated-with-this-fieldname#post269910
which seems to suggest that auto-updating forms is actually the intended behavior (at least nowadays).

Assuming the latter is correct, I now have a UX concern. I couldn’t find a supported way to update only the changed fields (which in my case are read-only), or at least to exclude a specific form from cache synchronization (the form is used to edit the grid’s records). Passing only the primary key and the changed values in the updateCaches() call works as expected for a DynamicForm, but doesn’t work for a ListGrid as it will clear the other values in the record.

What is the recommended best practice for handling this use case?

hi Claudio, thanks for the report.

The code was meant to provide an enum of options (always, whenSaving, never) but the implementation wasn’t finished/made public.

We’ll finish that work in the coming days and get back to you.

If you need an immediate fix, you can set undocumented disableUnboundCacheSync on your form.

Thanks, I’ll try the immediate fix and then I’ll wait for the implementation.

As an unrelated note, I just noticed that when sharing this thread link on Telegram, the preview shows unrelated gambling content instead of the forum thread.

I don’t know if it may indicate a security issue.

You should find the new property, DF/VM.cacheSync, in today’s builds. Options are always, whenSaving and never. Note also that, irrespective of that setting, cache-sync will no longer replace locally edited values that are pending a save - if the cache-sync value differs from your local edit, it’s still a valid edit and is not dropped. If the two match, the local edit is discarded, so it isn’t shown as a pending save.

Thanks for the unrelated notification about the gambling content on Telegram - you should find that addressed also.

SmartClient Version: v13.1p_2026-09-28/AllModules Development Only (built 2026-09-28)

Hi, I’m testing the new property, great feature BTW.

I think I may have found a little bug, when the record used for updateCaches hasn’t a key for a user edited formItem. Please try this test case:

isc.ListGrid.create({
    ID: "dsListGrid",
    width: "100%",
    height: "100%",
    autoFetchData: true,
    dataSource: "supplyItem",
    recordClick: "form.editRecord(record)"
});
isc.DynamicForm.create({
    ID: "form",
    showPending: true,
    width: "100%",
    height: "100%",
    dataSource: "supplyItem"
});
isc.HLayout.create({
    width: "100%",
    height: "100%",
    members: [dsListGrid, form]
});
  • select the first record (or a record without a description)
  • type something in the description
  • then execute:
var rec = supplyItem.copyRecord(dsListGrid.getSelectedRecord());
delete rec.description;
supplyItem.updateCaches({
    data: [rec],
    operationType: "update"
});

isc.logEcho(form.getChangedValues());
  • you’ll see that the pending edit stops counting as changed

hi Claudio - we see the issue and we’ll get it fixed for tomorrow’s builds.

SmartClient Version: v13.1p_2026-10-06/AllModules Development Only (built 2026-10-06)

I see it’s fixed, thank you very much!

A small thing in the docs: in the CacheSyncMode reference, the paragraph “An update never discards an edit the user has made and not yet saved…” is indented as part of the description of “never”, so it reads as if it only applied there.
But I think it actually applies to the overall behaviour.