Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
122
rated 0 times [  123] [ 1]  / answers: 1 / hits: 16352  / 10 Years ago, fri, september 26, 2014, 12:00:00

I have an Oracle ApEx (version 4.2.5) database application with 1 Home type page displaying the current records in a table and a DML Form type page where you can insert/update/delete records to the same table. That is a generic Report and Form type application.



On the 2nd page, I want to set value of 4 text fields on change of a specific text field named P2_KOD. For that, I have created a dynamic action regarding that specific text field. I have set event to Change, selection type to Item(s), item(s) to P2_KOD and left condition null (ie. - No Condition -).



Then I have added a true action to set values of 4 text fields. I have tried Set Value actions of both PL/SQL Function Body and JavaScript Expression. But I could not manage to set display values of that 4 text field. I know that I can set the session values of that 4 text field since I see them in Inserted state with correct item values assigned in the Seesion info.



What is wrong with my configuration?



Edit#1: I have created the same scneario on apex.oracle.com. You can login with the following credentials and check out the Application 76791 - Simple Rep & Form App. There is a dynamic action named WHEN_DEPT_CHANGED which should change the value of P2_COMM to 3 times the value of department.



Workspace: DANTE_DEO
UN : anonymous_developer
PW : ad

More From » plsql

 Answers
2

You are getting the error:



Uncaught TypeError: string is not a function 


For this JS in 'Execute JS Code':



$x('P2_COMM').innerHTML = $x('P2_EMPNO').value() * 3;
$x('P2_COMM').value = $x('P2_EMPNO').value() * 3;


It's because .value() is not a function, it's like a property. Change to:



$x('P2_COMM').innerHTML = $x('P2_EMPNO').value * 3;
$x('P2_COMM').value = $x('P2_EMPNO').value * 3;


And you should be in business.



Handy hint: You can debug JS code in Apex (or anything) by using the console in Google Chrome (hit F12, navigate to console and refresh the page) or with the Firebug extension in Firefox.


[#69323] Wednesday, September 24, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
keric

Total Points: 572
Total Questions: 93
Total Answers: 97

Location: Cyprus
Member since Mon, Oct 24, 2022
2 Years ago
;