Neurotic
Neurotic

Reputation: 210

dynamically changing the APEX_ITEM. TEXT value in Oracle apex

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

Upvotes: 3

Views: 4685

Answers (1)

Tony Andrews
Tony Andrews

Reputation: 132570

You can do this with a (moderately complex) dynamic action as follows.

  1. Action fires when the user changes any element with name "f06" (i.e. attribute3 which you have defined with p_idx=>6).

enter image description here

  1. 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.

enter image description here

Upvotes: 4

Related Questions