There are some, maybe rare, use case when you want to set the "Suppress Change Event" switch of a Dynamic Action to "Yes". Usually that's only necessary when the Dynamic Action is fired On Change and executes a Set Value with the same field as a target. There might be a chain of events leading to this or just one. If you forget to set it you'll end up in an endless loop and your browser will choke.
That works all fine and as expected with regular Page Items.
However ... when you apply this to a column in an Interactive Grid something unexpected happens. When you set the Suppress Change Event of a Dynamic Action that fires on change of a column to Yes, the value of that item seems empty when you leave that field (column)! If you navigate back into that field, the (new) value does show up...
You can call it a feature, you can call it a bug, but bottom line it is unexpected and undesired behaviour. The solution is to call the Grid method SetActiveRecordValue after you set the value.
Thus, next to the Set Value step, you need an Execute JavaScript step with code like this:
Of course you should not code this JavaScript directly into the Dynamic Action but create either a JavaScript function that accepts two parameters (region and column) or - in my opinion the preferred solution - create a (simple) plugin (with two attributes) that executes this piece of JavaScript.
(This is the behaviour currently on APEX 18.2)
That works all fine and as expected with regular Page Items.
However ... when you apply this to a column in an Interactive Grid something unexpected happens. When you set the Suppress Change Event of a Dynamic Action that fires on change of a column to Yes, the value of that item seems empty when you leave that field (column)! If you navigate back into that field, the (new) value does show up...
You can call it a feature, you can call it a bug, but bottom line it is unexpected and undesired behaviour. The solution is to call the Grid method SetActiveRecordValue after you set the value.
Thus, next to the Set Value step, you need an Execute JavaScript step with code like this:
var grid$ = apex.region( "myGrid" ).call( "getCurrentView" ).view$;
grid$.grid("lockActive");
setTimeout( function() {
// the grid model is not updated so call setActiveRecordValue
grid$.grid( "setActiveRecordValue", "SAL" )
.grid( "unlockActive" );
}, 100 );
Of course you should not code this JavaScript directly into the Dynamic Action but create either a JavaScript function that accepts two parameters (region and column) or - in my opinion the preferred solution - create a (simple) plugin (with two attributes) that executes this piece of JavaScript.
(This is the behaviour currently on APEX 18.2)
Comments