I am using the onchange column(s) dynamic actions to dynamically update one cell in an IG based on another cell in the same row. I've seen articles and examples that so something similar though I haven't seen an example that does exactly this. I have my own example in apex.oracle.com. Unfortunately it doesn't update correctly if I click to a different row after editing. Here is the example:
https://apex.oracle.com/pls/apex/f?p=41726:8:235817727455::NO:::
workspace: jackiewomble
username: demo
password: demodemo
application: JW 18.2 demo
page: Updating Columns
The goal:
- When updating the salary, the commission on the same row automatically updates to 1/8 of the salary.
The method:
- onchange column(s) dynamic action for SAL column.
- dynamic action has a set value action with affected element = columns(s) with the column name COMM.
- set value action has Suppress Change Event = Yes and Fire on Initialization = No.
- The setting can be either a PL/SQL expression :SAL / 8 or a JavaScript expression calcComm(this.triggeringElement).
The results:
- The comm is set correctly if you click on the same row after editing the sal cell.
- However the comm cell is not set correctly if you click on a different row after editing the sal cell.
So I wonder what is happening? Is the DA setting the value based on the “active record” which changes when you click on a different row?
I am aware of the "Dynamic Column Total" example in the IG cookbook, and I've tried to adapt that example, but if I try to set a cell inside the model (rather than set a page item) it doesn’t set correctly.