I have an application where I have created classic report. it has 4 columns.
SELECT KEY,
APEX_ITEM.TEXT(6,attribute3,10) attribute3,
APEX_ITEM.HIDDEN(3,KEY) ||
APEX_ITEM.TEXT(4,attribute1, 10) attribute1,
APEX_ITEM.TEXT(5,attribute2, 10) attribute2
FROM table1 ;
I want to dynamically change the value for attribute2 based on attribute1.
attribute2 = attribute3*attribute1
, where attribute3 will be pre-fetched and attribute1 will be entered by user
.
I want to calculate attribute3 on-fly(dynamically), based on changes in attribute1.
Version: 4.2.1
You can do this with a (moderately complex) dynamic action as follows.
- Action fires when the user changes any element with name "f06" (i.e. attribute3 which you have defined with p_idx=>6).
- The action taken is to run some Javascript that finds the other 2 elements named "f04" and "f05" in the same row, get the value of the "f04" and "f06" elements, multiply them and store the result in the "f05" element.
来源:https://stackoverflow.com/questions/36003828/dynamically-changing-the-apex-item-text-value-in-oracle-apex