SlideShare a Scribd company logo
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript to APEX Apps
Introduction to JavaScript for APEX Developers
Module 2: Adding JavaScript to APEX Apps
2
Dynamic Actions
Agenda
1
2
3
4
Dynamic Actions with JavaScript hooks
Page and component level attributes
Static files
3
Dynamic Actions
Agenda
1
4
What are Dynamic Actions?
§ A declarative way to add dynamic behaviors to a page
• Configure attributes to specify what happens and when
• APEX generates the JavaScript, or you can supply your own
§ Two parts
• Dynamic Action: the event and related component
• Actions: the response, such as ‘hide’ or ‘show’
5
Thinking through Dynamic Actions
6
Action
Event
Thinking through Dynamic Actions
7
Action
Event
Action
Action
Thinking through Dynamic Actions
8
Actions
Dynamic Action
Action
Event
Action
Action
Thinking through Dynamic Actions
9
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Thinking through Dynamic Actions
10
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Action
Action
Action
Action
Thinking through Dynamic Actions
11
Actions
Dynamic Action
ActionAction
ConditionEvent
False True
Action
Action
Action
Action
Many actions can
be configured to fire
at page load too.
Example 1
§ Disable Alternate Number field until the Phone Number is populated
12
Example 1
§ Disable Alternate Number field until the Phone Number is populated
13
• What’s the driver?
• Is there a condition?
• What are the true/false actions?
• Relevant at page load too?
Example 1
§ Disable Alternate Number field until the Phone Number is populated
14
Actions
Dynamic Action
Disable Alt. PhoneEnable Alt. Phone
Value is nullPhone Num. changes
False True
Example 1
§ Disable Alternate Number field until the Phone Number is populated
15
Actions
Dynamic Action
Disable Alt. PhoneEnable Alt. Phone
Value is nullPhone Num. changes
False True
+ PL + PL
Example 2
§ Hide List Price and Product Image if Product Available is No
16
Example 2
§ Hide List Price and Product Image if Product Available is No
17
• What’s the driver?
• Is there a condition?
• What are the true/false actions?
• Relevant at page load too?
Example 2
§ Hide List Price and Product Image if Product Available is No
18
Actions
Dynamic Action
Hide Price & ImageShow Price & Image
Value = 'N'Product Avail. changes
False True
Show Image region Hide Image Region
Example 2
§ Hide List Price and Product Image if Product Available is No
19
Actions
Dynamic Action
Hide Price & ImageShow Price & Image
Value = 'N'Product Avail. changes
False True
Show Image region Hide Image Region
+ PL
+ PL
+ PL
+ PL
Agenda
2 Dynamic Actions with JavaScript hooks
20
Dynamic Actions with JavaScript hooks
§ Dynamic Actions can’t cover everything
• Hooks are provided to extend capabilities
• Requires basic knowledge of JavaScript to use
§ Probably the sweet spot for most APEX developers
21
Dynamic Action: Event and Selection Type
§ Custom Event option accepts any event name
§ jQuery Selector provides a flexible means of selecting elements
22
Dynamic Action: Client-side Condition
§ Declarative conditions only work with the triggering element
§ The JavaScript Expression option provides full access to the DOM
• Must resolve to true or false
• See the “help” for additional options
23
Actions: Execute JavaScript
§ Declarative options are great for common interactions
• Hide/show, enable/disable, refresh, etc.
§ Execute JavaScript can do anything not available out of the box
24
Agenda
3 Page and component level attributes
25
Page level attributes
§ Dynamic Actions may not work for every situation
• The dynamic action/actions structure can be a little rigid
• Handwritten JavaScript code may be a better solution
§ Page level attributes for JavaScript are the next step
• Provide a consistent place to put JavaScript code
§ Relatively few APEX developers will need to do this
26
Using page level attributes
§ Function and Global Variable Declaration
• Code here is in the global scope
• Before DOM load and component initialization
§ Execute when Page Loads
• Code here is in a function scope
• After DOM load and component initialization
27
Component level attributes
§ Various components have a “JavaScript Initialization Code” attribute
• Allows customization beyond declarative attributes
28
Regions
Interactive Grid (region and column level)
Chart
Calendar
Tree
Items
HTML Editor
Markdown Editor (19.2+)
Popup LOV (19.2+)
Using component level attributes
§ Capabilities will vary by component
• See help for examples
• See doc for a list of attributes
29
https://apex.oracle.com/jsapi
Agenda
4 Static files
30
Static files
§ Static files have several advantages over page level attributes
• Faster page loads via browser caching and optional minification
• Better organization; easier to reuse code between pages
§ Very few APEX developers will ever need to do this
• Consider plug-ins instead when possible
31
Using static files on a page
§ Files can be placed in various locations
• Most convenient: App/Workspace images
• Most performant: File server (Apache, Nginx, etc.)
32
Using static files throughout an app
§ Heavily reused code can be made available on all pages
33
See the JS doc for additional info on adding JavaScript to APEX
34 https://apex.oracle.com/jsapi
Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript to APEX Apps

More Related Content

PDF
Module 1: JavaScript Basics
PPTX
Dynamic Actions, the Hard Parts
PDF
Module 2: Adding JavaScript to APEX Apps
PDF
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
PDF
Intro to JavaScript for APEX Developers
PPTX
Intro to GraphQL for Database Developers
PDF
Module 3: Working with the DOM and jQuery
PDF
GraphQL London January 2018: Graphql tooling
Module 1: JavaScript Basics
Dynamic Actions, the Hard Parts
Module 2: Adding JavaScript to APEX Apps
Introduction to JavaScript for APEX Developers - Module 1: JavaScript Basics
Intro to JavaScript for APEX Developers
Intro to GraphQL for Database Developers
Module 3: Working with the DOM and jQuery
GraphQL London January 2018: Graphql tooling

What's hot (20)

PDF
GraphQL across the stack: How everything fits together
PDF
How web works and browser works ? (behind the scenes)
PDF
React and GraphQL at Stripe
PDF
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
PDF
GraphQL over REST at Reactathon 2018
PDF
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
PDF
Oracle APEX for Beginners
PDF
Matheus Marsiglio - Isomorphic React + Redux App
PDF
The Apollo and GraphQL Stack
PDF
Raphael Amorim - Scrating React Fiber
PPT
JSF (ADF) Case Studies Presentation
PDF
Introduction to React Native
PDF
Oracle adfj developer slides
PPTX
GraphQL, Redux, and React
PDF
James Baxley - Statically typing your GraphQL app
PDF
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
PPTX
Creating Single Page Applications with Oracle Apex
PDF
Oracle ADF Task Flows for Beginners
PDF
Introduction to React Native Workshop
PDF
React Native Workshop - React Alicante
GraphQL across the stack: How everything fits together
How web works and browser works ? (behind the scenes)
React and GraphQL at Stripe
Why UI Developers Love GraphQL - Sashko Stubailo, Apollo/Meteor
GraphQL over REST at Reactathon 2018
GraphQL as an alternative approach to REST (as presented at Java2Days/CodeMon...
Oracle APEX for Beginners
Matheus Marsiglio - Isomorphic React + Redux App
The Apollo and GraphQL Stack
Raphael Amorim - Scrating React Fiber
JSF (ADF) Case Studies Presentation
Introduction to React Native
Oracle adfj developer slides
GraphQL, Redux, and React
James Baxley - Statically typing your GraphQL app
AllThingsOpen 2018 - Deployment Design Patterns (Dan Zaratsian)
Creating Single Page Applications with Oracle Apex
Oracle ADF Task Flows for Beginners
Introduction to React Native Workshop
React Native Workshop - React Alicante
Ad

Similar to Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript to APEX Apps (20)

PPTX
JavaScript: Why Should I Care?
PDF
Practical Dynamic Actions - Intro
PDF
My Top 5 APEX JavaScript API's
PPTX
Oracle apex training
PPTX
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
PPTX
APEX Office Hours Interactive Grid Deep Dive
DOCX
Oracle apex course content
PPT
St Hilaire Ajax Start Odtug Nov 2009
PDF
APEX Bad Practices
PPTX
Plugins unplugged
PPT
Intro to Application Express
PDF
Unlocking the power of the APEX Plugin Architecture
PPT
Web Development In Oracle APEX
PDF
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
PDF
UNYOUG - APEX 19.2 New Features
PDF
Apex behind the scenes
PDF
Pretius Oracle Apex Primer
PDF
Alt tab - better apex tabs
PPTX
apex-42-new-features-1867076-lowcode_developpment.pptx
PPTX
SFDC UI - Advanced Visualforce
JavaScript: Why Should I Care?
Practical Dynamic Actions - Intro
My Top 5 APEX JavaScript API's
Oracle apex training
APEX Alpe Adria 2019 - JavaScript in APEX - do it right!
APEX Office Hours Interactive Grid Deep Dive
Oracle apex course content
St Hilaire Ajax Start Odtug Nov 2009
APEX Bad Practices
Plugins unplugged
Intro to Application Express
Unlocking the power of the APEX Plugin Architecture
Web Development In Oracle APEX
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
UNYOUG - APEX 19.2 New Features
Apex behind the scenes
Pretius Oracle Apex Primer
Alt tab - better apex tabs
apex-42-new-features-1867076-lowcode_developpment.pptx
SFDC UI - Advanced Visualforce
Ad

Recently uploaded (20)

PDF
DevOps & Developer Experience Summer BBQ
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
Chapter 2 Digital Image Fundamentals.pdf
PDF
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
PDF
Revolutionize Operations with Intelligent IoT Monitoring and Control
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
SparkLabs Primer on Artificial Intelligence 2025
PDF
Google’s NotebookLM Unveils Video Overviews
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
Enable Enterprise-Ready Security on IBM i Systems.pdf
PDF
creating-agentic-ai-solutions-leveraging-aws.pdf
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Transforming Manufacturing operations through Intelligent Integrations
DevOps & Developer Experience Summer BBQ
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Chapter 2 Digital Image Fundamentals.pdf
CIFDAQ's Token Spotlight: SKY - A Forgotten Giant's Comeback?
Revolutionize Operations with Intelligent IoT Monitoring and Control
A Day in the Life of Location Data - Turning Where into How.pdf
Smarter Business Operations Powered by IoT Remote Monitoring
GamePlan Trading System Review: Professional Trader's Honest Take
Understanding_Digital_Forensics_Presentation.pptx
SparkLabs Primer on Artificial Intelligence 2025
Google’s NotebookLM Unveils Video Overviews
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
How Much Does It Cost to Build a Train Ticket App like Trenitalia in Italy.pptx
Reimagining Insurance: Connected Data for Confident Decisions.pdf
Enable Enterprise-Ready Security on IBM i Systems.pdf
creating-agentic-ai-solutions-leveraging-aws.pdf
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Transforming Manufacturing operations through Intelligent Integrations

Introduction to JavaScript for APEX Developers - Module 2: Adding JavaScript to APEX Apps

  • 2. Introduction to JavaScript for APEX Developers Module 2: Adding JavaScript to APEX Apps 2
  • 3. Dynamic Actions Agenda 1 2 3 4 Dynamic Actions with JavaScript hooks Page and component level attributes Static files 3
  • 5. What are Dynamic Actions? § A declarative way to add dynamic behaviors to a page • Configure attributes to specify what happens and when • APEX generates the JavaScript, or you can supply your own § Two parts • Dynamic Action: the event and related component • Actions: the response, such as ‘hide’ or ‘show’ 5
  • 6. Thinking through Dynamic Actions 6 Action Event
  • 7. Thinking through Dynamic Actions 7 Action Event Action Action
  • 8. Thinking through Dynamic Actions 8 Actions Dynamic Action Action Event Action Action
  • 9. Thinking through Dynamic Actions 9 Actions Dynamic Action ActionAction ConditionEvent False True
  • 10. Thinking through Dynamic Actions 10 Actions Dynamic Action ActionAction ConditionEvent False True Action Action Action Action
  • 11. Thinking through Dynamic Actions 11 Actions Dynamic Action ActionAction ConditionEvent False True Action Action Action Action Many actions can be configured to fire at page load too.
  • 12. Example 1 § Disable Alternate Number field until the Phone Number is populated 12
  • 13. Example 1 § Disable Alternate Number field until the Phone Number is populated 13 • What’s the driver? • Is there a condition? • What are the true/false actions? • Relevant at page load too?
  • 14. Example 1 § Disable Alternate Number field until the Phone Number is populated 14 Actions Dynamic Action Disable Alt. PhoneEnable Alt. Phone Value is nullPhone Num. changes False True
  • 15. Example 1 § Disable Alternate Number field until the Phone Number is populated 15 Actions Dynamic Action Disable Alt. PhoneEnable Alt. Phone Value is nullPhone Num. changes False True + PL + PL
  • 16. Example 2 § Hide List Price and Product Image if Product Available is No 16
  • 17. Example 2 § Hide List Price and Product Image if Product Available is No 17 • What’s the driver? • Is there a condition? • What are the true/false actions? • Relevant at page load too?
  • 18. Example 2 § Hide List Price and Product Image if Product Available is No 18 Actions Dynamic Action Hide Price & ImageShow Price & Image Value = 'N'Product Avail. changes False True Show Image region Hide Image Region
  • 19. Example 2 § Hide List Price and Product Image if Product Available is No 19 Actions Dynamic Action Hide Price & ImageShow Price & Image Value = 'N'Product Avail. changes False True Show Image region Hide Image Region + PL + PL + PL + PL
  • 20. Agenda 2 Dynamic Actions with JavaScript hooks 20
  • 21. Dynamic Actions with JavaScript hooks § Dynamic Actions can’t cover everything • Hooks are provided to extend capabilities • Requires basic knowledge of JavaScript to use § Probably the sweet spot for most APEX developers 21
  • 22. Dynamic Action: Event and Selection Type § Custom Event option accepts any event name § jQuery Selector provides a flexible means of selecting elements 22
  • 23. Dynamic Action: Client-side Condition § Declarative conditions only work with the triggering element § The JavaScript Expression option provides full access to the DOM • Must resolve to true or false • See the “help” for additional options 23
  • 24. Actions: Execute JavaScript § Declarative options are great for common interactions • Hide/show, enable/disable, refresh, etc. § Execute JavaScript can do anything not available out of the box 24
  • 25. Agenda 3 Page and component level attributes 25
  • 26. Page level attributes § Dynamic Actions may not work for every situation • The dynamic action/actions structure can be a little rigid • Handwritten JavaScript code may be a better solution § Page level attributes for JavaScript are the next step • Provide a consistent place to put JavaScript code § Relatively few APEX developers will need to do this 26
  • 27. Using page level attributes § Function and Global Variable Declaration • Code here is in the global scope • Before DOM load and component initialization § Execute when Page Loads • Code here is in a function scope • After DOM load and component initialization 27
  • 28. Component level attributes § Various components have a “JavaScript Initialization Code” attribute • Allows customization beyond declarative attributes 28 Regions Interactive Grid (region and column level) Chart Calendar Tree Items HTML Editor Markdown Editor (19.2+) Popup LOV (19.2+)
  • 29. Using component level attributes § Capabilities will vary by component • See help for examples • See doc for a list of attributes 29 https://apex.oracle.com/jsapi
  • 31. Static files § Static files have several advantages over page level attributes • Faster page loads via browser caching and optional minification • Better organization; easier to reuse code between pages § Very few APEX developers will ever need to do this • Consider plug-ins instead when possible 31
  • 32. Using static files on a page § Files can be placed in various locations • Most convenient: App/Workspace images • Most performant: File server (Apache, Nginx, etc.) 32
  • 33. Using static files throughout an app § Heavily reused code can be made available on all pages 33
  • 34. See the JS doc for additional info on adding JavaScript to APEX 34 https://apex.oracle.com/jsapi