Oracle APEX 'Dynamic Actions' overview, presented during the Oracle APEX Office Hours session on Thursday 18th October 2018.
https://apex.oracle.com/officehours
3. Anthony Rayner
• 2004: Graduated Plymouth University, Computing
• 2005: Joined Oracle in Technical Consulting
• 2008: Transferred to APEX Development Team
• Now: Principal Member of Technical Staff
• Work includes: Dynamic Actions, Page Designer,
Interactive Grid, Accessibility Lead
• Twitter: @anthonyrayner
4. Safe Harbor
The following is intended to outline Oracle’s general
product direction. It is intended for information
purposes only, and may not be incorporated into any
contract. It is not a commitment to deliver any
material, code, or functionality, and should not be
relied upon in making purchasing decisions.
The development, release, and timing of any features
or functionality described for Oracle’s products
remains at the sole discretion of Oracle.
Demo: Show simple example:
DA Sample app: disable / enable. Just runtime to start.
Plug-ins
Fully extensible, via the APEX plug-in architecture
JavaScript hooks
‘Execute JavaScript Code’ action
‘JavaScript Expression’ condition type
‘Set Value’ action has a ‘Set Type’ of ‘JavaScript Expression’
Powerful jQuery selector attributes exposed, allowing for flexible definition of the when and then what of dynamic actions
Debugging
- Client-side logging available
- Still requires application level ‘Debug’ to be enabled and switched on
- Requires a browser to have a JavaScript console, standard these days
- Outputs dynamic action name, specific action, and a context object containing the following information:
var lContext = { triggeringElement : pTriggeringElement, affectedElements : $( pSelector, apex.gPageContext$ ), action : pAction, browserEvent : pBrowserEvent, data : pData, resumeCallback : pResumeCallback};
So first of all, let’s take a minute to understand the anatomy of a Dynamic Action, and it’s comprised of 3 simple parts.
The ‘When’, the ‘Action’ and the ‘Affected Elements’.
The when describes when the Dynamic Action will fire; for example when an item’s value changes, when a button is clicked.
The action describes what happens, for example disable, hide or refresh.
The affected elements are what the action influences; so the item that’s disabled, the report that’s hidden or the chart that’s refreshed.
Plan: 3.15
Plan: 3.35
Adds to maintenance overhead
Adds to page size
Complicates debugging
Use APEX standard server side page processing, don’t overuse page load DAs
Open network tab and observe during development
Anywhere you use custom JavaScript, always think is there an easier way? For example a DA plug-in.