Discussions
Categories
- 197.1K All Categories
- 2.5K Data
- 546 Big Data Appliance
- 1.9K Data Science
- 450.7K Databases
- 221.9K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 31 Multilingual Engine
- 552 MySQL Community Space
- 479 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.1K ORDS, SODA & JSON in the Database
- 555 SQLcl
- 4K SQL Developer Data Modeler
- 187.2K SQL & PL/SQL
- 21.3K SQL Developer
- 296.3K Development
- 17 Developer Projects
- 139 Programming Languages
- 293K Development Tools
- 110 DevOps
- 3.1K QA/Testing
- 646.1K Java
- 28 Java Learning Subscription
- 37K Database Connectivity
- 158 Java Community Process
- 105 Java 25
- 22.1K Java APIs
- 138.2K Java Development Tools
- 165.3K Java EE (Java Enterprise Edition)
- 19 Java Essentials
- 162 Java 8 Questions
- 86K Java Programming
- 81 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 204 Java User Groups
- 24 JavaScript - Nashorn
- Programs
- 466 LiveLabs
- 39 Workshops
- 10.2K Software
- 6.7K Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 175 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 233 Portuguese
Trigger Dynamic Action from Popup Window

I have a pop up window which a user chooses a name from a report (address book). When they select the user the name, phone, and email populate the main form. The pop up has JavaScript that populates the opener.document fields. I created a Dynamic Action that uses the on change event to run a PL/SQL code to fill in the users supervisors information. The problem is the setting the fields in the opener from the popup appears to not trigger the onchange event. If I manually enter the information the process triggers and works. I have tried several ways to set the value using the $s() and document.getElement... but still no onchange trigger. I googled to see if someone else encountered this and had a solution but did not find any that works. I came across the apex.event.trigger but it fires it the pop up window and not in the opener window. I could not find any way to reference through javascript, jquery, or apex the "opener.window" to trigger the change.
I was wondering if anyone had any solution or thoughts of a solution?
Thanks in advance for all assistance.
Lawrence
Oracle APEX 4.2.6
Database 11g
Chrome Browser
Answers
-
Hi Lawrence,
You can use a dynamic action that fires with a custom event in opener page and trigger it from popup using "parent". The javascript code should be something like this:
parent.$('#item_id').trigger("someevent");
Hope this helps,
Sergio
-
Thanks Seregio but it didn't work either. I am setting the parent fields via javascript from the pop up. It appears the the change event is not happening. If I set the field manually on the parent the change event triggers.
-
Ok, do you really need to fire the action when item changes? Otherwise you can fire dynamic action for event "Dialog closed".
-
Sergio,
I have a dynamic action that fires when the user enters a name in the assigned field. It queries a table for the supervisor name and populates the name, phone and email field automatically. When I type in the field it works perfectly. I have a popup window that shows our address book. The user can search for a name and click on it to populate the assigned field. I do this so that we have standard entry of the assigned name. e.g. entry of Daniel Smith vs Dan Smith. But what is happening is that the "change" event does not trigger when I populate the fields via javascript from the popup. Even using some of the javascript to trigger on the parent window does not work. Right now the user has to enter both user and supervisor. This is not a critical issue but would be nice to solve as I can use this process in other applications in several situations.
-
Hi Lawrence,
You should add a new dynamic action assigned to "custom event" that have same actions of your actual "on click item" DA.
Then you must call this new DA from javascript like I've explained above.
Sergio
-
Sergio,
I did try that but it could not get the action to trigger. I even tried just doing an alert to see if the DA would trigger and no luck. I have tried custom event, jquery selector and several other options but none worked. I have no problems doing it if I am on the same page. It is only when I am in the pop up that I cannot get it to fire on the parent. I'll keep looking at it. Thanks for the help.
Lawrence