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
ADF and JavaScript - AMIS SIG, July 2017
PPSX
React introduction
PDF
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
PDF
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
PPTX
Web Performance & Latest in React
PDF
Performance and Scalability Art of Isomorphic React Applications
PDF
Isomorphic React Applications: Performance And Scalability
PDF
Opticon 2015-Experience Optimization in Modern Web Architecture
PDF
Server rendering-talk
PDF
Practical Dynamic Actions - Intro
PDF
wt mod3.pdf
PPTX
Client Best Practices
PDF
React Tech Salon
PPTX
React & redux
PDF
H2O World - Building a Smarter Application - Tom Kraljevic
PDF
26 story slicing techniques for any scrum team
PDF
Web Development with Delphi and React - ITDevCon 2016
PDF
JavaScript for NET Developers 1st Edition Ovais Mehboob Ahmed Khan
PDF
JavaScript for NET Developers 1st Edition Ovais Mehboob Ahmed Khan
ADF and JavaScript - AMIS SIG, July 2017
React introduction
Reconciling ReactJS as a View Layer Replacement (MidwestJS 2014)
MidwestJS 2014 Reconciling ReactJS as a View Layer Replacement
Web Performance & Latest in React
Performance and Scalability Art of Isomorphic React Applications
Isomorphic React Applications: Performance And Scalability
Opticon 2015-Experience Optimization in Modern Web Architecture
Server rendering-talk
Practical Dynamic Actions - Intro
wt mod3.pdf
Client Best Practices
React Tech Salon
React & redux
H2O World - Building a Smarter Application - Tom Kraljevic
26 story slicing techniques for any scrum team
Web Development with Delphi and React - ITDevCon 2016
JavaScript for NET Developers 1st Edition Ovais Mehboob Ahmed Khan
JavaScript for NET Developers 1st Edition Ovais Mehboob Ahmed Khan
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
PPTX
Big Data Technologies - Introduction.pptx
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPT
Teaching material agriculture food technology
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
DOCX
The AUB Centre for AI in Media Proposal.docx
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology
Big Data Technologies - Introduction.pptx
MYSQL Presentation for SQL database connectivity
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Weekly Chronicles - August'25 Week I
Building Integrated photovoltaic BIPV_UPV.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Mobile App Security Testing_ A Comprehensive Guide.pdf
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Teaching material agriculture food technology
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
The AUB Centre for AI in Media Proposal.docx
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?

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