I think I've encountered a bug with interactive grid when trying to use a dynamic action to set multiple column values. Any help would be appreciated. My current version if 5.1.4.
Goal
To create a dynamic action on one column that when values in that column are changed it will set values on multiple other columns on the same line.
Issue
Defined dynamic action with event type of “change” then associated a “true” action of “set value”. The dynamic action does not set values correctly in all “affected elements” (columns). Instead it sets the same values in all columns (affected elements) to same value. The value that is shown is the first value in the sql statement of the “Set Value” dynamic action.
Demo
To show the issue I’ve created a demo app on apex.oracle.com. To see the issue do the following.
- 1- Click “Add Row” button
- 2- Select a “Fruit Name” from the LOV.
- 3- See how the same values are populated in all columns to right of “fruit name”.
Link to example https://apex.oracle.com/pls/apex/f?p=35582:1
Setup
CREATE SEQUENCE fruits_s NOCACHE INCREMENT BY 1 START WITH 101;
CREATE SEQUENCE order_lines_s NOCACHE INCREMENT BY 1 START WITH 101;
CREATE TABLE fruits
(fruit_id NUMBER(15)
,fruit_name VARCHAR2(50)
,shape VARCHAR2(50)
,color VARCHAR2(50)
,taste VARCHAR2(50)
,CONSTRAINT fruits_pk PRIMARY KEY (fruit_id)
);
CREATE TABLE order_lines
(order_line_id NUMBER(15)
,fruit_id NUMBER(15)
,CONSTRAINT order_line_pk PRIMARY KEY (order_line_id)
,CONSTRAINT order_line_fk1 FOREIGN KEY (fruit_id) REFERENCES fruits
);
INSERT INTO fruits VALUES (fruits_s.nextval, 'Orange', 'round', 'orange', 'sweet');
INSERT INTO fruits VALUES (fruits_s.nextval, 'Apple', 'round', 'red', 'tart');
INSERT INTO fruits VALUES (fruits_s.nextval, 'Grape', 'round', 'green', 'sweet');
INSERT INTO fruits VALUES (fruits_s.nextval, 'Plum', 'round', 'purple', 'sweet');
INSERT INTO order_lines VALUES (order_lines_s.nextval, 101);
INSERT INTO order_lines VALUES (order_lines_s.nextval, 102);
COMMIT;
Defined an interactive grid with this query. The idea is that user selects from LOV a value for “fruit_id” then the dynamic action returns values for the other columns (shape, color, taste).
select ol.ORDER_LINE_ID
,ol.FRUIT_ID
,f.shape
,f.color
,f.taste
from ORDER_LINES ol
,fruits f
where ol.fruit_id = f.fruit_id
Defined dynamic action on fruit_id column.

Dynamic action definition as event of “Change”

True action is Set Value

Image shows the result for the dynamic action to set values does not set multiple values correctly. See how the same value is used in all columns.

Thanks,
Todd