I have a Content Row region that is refreshed when an inline dialog is closed, using:
apex.region(<REGION_STATIC_ID>).refresh();
I also have a Dynamic Action that is set to fire on After Refresh of the Content Row region, but the Dynamic Action is not being triggered.
The documentation states that the refresh() function should return a promise, so I tried the following using a similar pattern as when using the promise from apex.server.process():
var myRefresh = apex.region(<REGION_STATIC_ID>).refresh();
myRefresh
.done(function() {
some callback code here.
});
But this throws an error that myRefresh.done is not a function. The promise does to include a .finally callback, but that doesn't seem to work in the same way as a .done, and has resulted in me having to resort to setTimeouts, see below:
var myRefresh = apex.region(<REGION_STATIC_ID>).refresh();
myRefresh
.finally(function() {
setTimeout(function() {
some callback code here.
}, 500);
});
This does not seem to work reliably through as sometimes the .finally appears to fire before the Content Row has completely refreshed, leading to me increasing the amount of time before the setTimeout fires.
So my questions are, is it a bug that an After Refresh Dynamic Action is not triggered by a Content Row region refresh? Is there a better work around than relying on .finally and setTimeouts to fire some additional JS after the Content Row has been refreshed?
Any advice or suggestions welcome!
Kind Regards,
Cj