SlideShare ist ein Scribd-Unternehmen logo
1 von 55
Downloaden Sie, um offline zu lesen
Custom ADF 
Components 
Deep Dive
About Us 
Richard Olrichs 
MN 
www.olrichs.nl 
@richardolrichs 
Wilfred van der Deijl 
The Future Group 
www.redheap.com 
@wilfreddeijl
Agenda 
● Live Demo Custom ADF Component 
● How to use 
● Deep dive code roundtrip 
○ server side java, css, client side javascript 
○ client and server events 
● Lessons Learned
Live Demo 
Custom ADF Component
How to use
Setup Consuming Project
JSF Tag 
● Facelets Tag 
(or JSP Tag for 11.1.1 and backwards 
compatibility)
Let’s Build It 
Server Side 
https://github.com/wvanderdeijl/adfcomponent (=http://bit.ly/adfcomp)
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent 
Server Side 
Client Side
Facelets Tag Library - rh.taglib.xml 
Identifiers, not Java classes 
Component Attributes
faces-config.xml - Faces Component 
Maps Component-Type identifier to 
implementing Component Java Class
have ADF super classes 
do the heavy work 
holds all state 
key per attr 
returnType & 
defaultValue 
group of components that 
typically share a renderer
Getters & Setters 
for component 
properties
Component Class 
● Server side instance 
○ what MyBean gets via MyBean.setSelector() with 
binding=”#{myBean.selector}” 
● Setters and Getters for all properties 
● Internally keeps state in FacesBean with 
setProperty, getProperty 
○ gives automatic state saving of JSF component tree 
between requests and on failover in cluster
MultiSelect component 
setId, setValue, setItemSelectListener, 
setPartialTriggers 
Add custom rule to 
set from super class
Facelets Handler Class 
● Supplies rules to automap facelets tag 
attributes from XML file to component class 
properties 
● Needed custom rule to support our 
ItemSelectListener attribute as Oracle’s ADF 
version only works for listeners from oracle. 
adf.view.rich package
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
faces-config.xml - Renderer 
ComponentFamily and RendererType from 
component used to lookup RendererClass
Which properties to expect 
from rendered component 
Find property keys once and 
describe client side props
Start of the HTML 
component 
Add ADF skin 
Encode the Item 
<input type=”hidden” 
value=”[0,1,2]”/>
render <li> for each item 
with <button> to select and <span> for delete
Component selector 
pseudo selector 
style subclassing 
http://myfaces.apache.org/trinidad/devguide/skinning.html
Apache Trinidad Content Compression 
On 
Off
Component Renderer 
● encodeAll method generates the HTML for 
the Component. 
● ADF Skin (including compression) 
○ more powerful than plain CSS 
○ skinning properties for Renderer like -tr-open-animation- 
duration 
○ relative colors: background-color: +#333333 
● Renderer lookup based on 
Family & RendererType from component 
● Taglib custom tag can override 
RendererType and thus re-use same 
component with different Renderer
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Let’s Build It 
Client Side
Client Side JavaScript Component 
Subclass from base ADF components 
Additional methods for client-side 
interaction with the component
Server-side Renderer determines 
Client JavaScript Component
ADF JavaScript Partitioning 
Dependency JS Client Constructor 
(defined by Renderer) 
ADF only downloads and runs needed JS 
core.js and any needed features
Component Peer Class 
Creates the 
RhMultiSelectPeer 
Use client side ADFLogger 
Register this Peer 
to ClickEvent 
Register this RhMultiSelectPeer 
for RhMultiSelect component
Best practice: assert for correct types 
Clicked delete icon 
DOM interaction 
Hidden input 
[0,1,2] ⇒ [0,2] 
Click button to select: Queue event to propagate to server
Client Side Select Event [1/2] 
Call superclass initializer 
with our event name 
getters and setters for client 
side interaction with event
Client Side Select Event [2/2] 
Queue event (called by Peer)
Client Component 
RhMultiSelect.js 
● Client-side representation of a server-side 
component 
● Public client-side API 
● Component state: Property container with 
support for event handling 
● All ADF Faces JavaScript classes are 
prefixed with Adf to avoid naming conflicts 
with other JavaScript libraries
Client Peer Object 
RhMultiSelectPeer.js 
Peer responsibilities: 
● DOM initialization and cleanup 
● DOM event handling 
● Geometry management 
● Partial page response handling 
● Child visibility change handling 
● Stateless private implementation
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Handle HTTP posts 
Server Side
Renderer Incoming HTTP Post 
Detect submitted value 
set Component’s 
SubmittedValue
Restore 
View 
Apply 
Request 
Values 
Process 
Validations 
Update 
Model 
Values 
Invoke 
Application 
Render 
Response 
JSF component’s “Local Value” 
written to ValueExpression 
eg. #{bindings.something.inputValue} 
SubmittedValue is converted to 
datatype of underlying model and 
stored in component’s “Local Value” 
Renderer invokes 
EditableValueHolder.setSubmittedValue() 
Invoke queued 
Listeners 
JSF Lifecycle 
Renderer uses 
SubmittedValue, 
“LocalValue” or 
“ModelValue”
Renderer Incoming HTTP Post 
Queue server-side 
ItemSelectEvent when receiving 
client itemSelect event
MultiSelect JSF Component Class
Managed Bean Event Listener
Renderer - Wrap up 
● Renderer decodeInternal() decodes the 
incoming http request 
○ check if component value is submitted in this 
request. If so, pass on to JSF component 
○ check for inbound events in the request
Component 
FacesBean 
Skin 
Renderer 
Component 
Peer 
Event 
ItemSelectEvent
Documentation
Starting point (11.1.2.4) 
http://docs.oracle.com/cd/E37975_01/web.111240/e16181/ad_custom.htm#CHDJIEDB
Documentation 
● Full Github sample - http://bit.ly/adfcomp 
● ADF Web User Interface Dev Guide 11.1.2.4 
○ 31 - Creating Custom ADF Faces Components 
● ADF Web User Interface Dev Guide 12.1.3 
○ 4 - ADF Faces Client Side Architecture 
○ Appendix A.2 - web.xml parameters 
○ Appendix F.1.1 - adf-js-partitions.xml 
● ADF Skin Editor Dev Guide 12.1.3 
● Apache Trinidad Skinning 
● JSF 2.1 Reference Documentation 
● ADF Source Code 
○ available from Oracle Support
Questions
Hidden Backup 
Slides
JavaScript 
● JavaScript libraries do not have 
namespaces, so prefix all JavaScript object 
names for the custom component using the 
same prefix. 
● Place each JavaScript object in its own 
separate source file for best practice and 
consistency.
Helpful stuff 
● web.xml parameters 
● Resource loading (zie: 
ImageResourceLoader) 
● Toevoegen <method-signature> in de taglib 
voor het snappen van methodExpression. 
●
view1.jsf 
Tag Lib 
Skin 
faces-config Component 
FacesBean 
Renderer 
Handler 
Component 
Peer 
Event 
ItemSelectEvent
Demo Shots 
Screen shots from the Demo
Adf component tech14

Weitere ähnliche Inhalte

Was ist angesagt?

A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2Jim Driscoll
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemoManishaChothe
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.NetHitesh Santani
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014Ran Wahle
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Salesforce Developers
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JSBinary Studio
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs WorkshopRan Wahle
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component BehaviorsAndy Schwartz
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1Neeraj Mathur
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UIravireddy76
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state managementpriya Nithya
 
Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopChristophe Coenraets
 

Was ist angesagt? (18)

Jsf
JsfJsf
Jsf
 
A Complete Tour of JSF 2
A Complete Tour of JSF 2A Complete Tour of JSF 2
A Complete Tour of JSF 2
 
Parallelminds.web partdemo
Parallelminds.web partdemoParallelminds.web partdemo
Parallelminds.web partdemo
 
Server Controls of ASP.Net
Server Controls of ASP.NetServer Controls of ASP.Net
Server Controls of ASP.Net
 
AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014AngularJs Workshop SDP December 28th 2014
AngularJs Workshop SDP December 28th 2014
 
Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2Mastering the Lightning Framework - Part 2
Mastering the Lightning Framework - Part 2
 
Academy PRO: React JS
Academy PRO: React JSAcademy PRO: React JS
Academy PRO: React JS
 
React render props
React render propsReact render props
React render props
 
angularJs Workshop
angularJs WorkshopangularJs Workshop
angularJs Workshop
 
2007 Zend Con Mvc
2007 Zend Con Mvc2007 Zend Con Mvc
2007 Zend Con Mvc
 
Jsf intro
Jsf introJsf intro
Jsf intro
 
JSF Component Behaviors
JSF Component BehaviorsJSF Component Behaviors
JSF Component Behaviors
 
Controls
ControlsControls
Controls
 
ASP.Net Presentation Part1
ASP.Net Presentation Part1ASP.Net Presentation Part1
ASP.Net Presentation Part1
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
 
Continuous Quality
Continuous QualityContinuous Quality
Continuous Quality
 
Asp.net state management
Asp.net state managementAsp.net state management
Asp.net state management
 
Salesforce Lightning Components Workshop
Salesforce Lightning Components WorkshopSalesforce Lightning Components Workshop
Salesforce Lightning Components Workshop
 

Ähnlich wie Adf component tech14

Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts NewLiquidHub
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts NewLiquidHub
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)mircodotta
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Rightmircodotta
 
ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017Lucas Jellema
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyPeter R. Egli
 
Specification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationSpecification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationAlexander Evseenko
 
Oracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceOracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceDeepak Bhagat
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React NativeEric Deng
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIGregor Zurowski
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and ReconciliationZhihao Li
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptWalid Ashraf
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentRob Windsor
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver DevelopmentJeremy Kao
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today Nitin Tyagi
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)Lucas Jellema
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive AppsJorge Ortiz
 

Ähnlich wie Adf component tech14 (20)

Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Creating Web Parts New
Creating Web Parts NewCreating Web Parts New
Creating Web Parts New
 
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
Lightbend Lagom: Microservices Just Right (Scala Days 2016 Berlin)
 
Lightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just RightLightbend Lagom: Microservices Just Right
Lightbend Lagom: Microservices Just Right
 
ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017ADF and JavaScript - AMIS SIG, July 2017
ADF and JavaScript - AMIS SIG, July 2017
 
Overview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technologyOverview of Microsoft .Net Remoting technology
Overview of Microsoft .Net Remoting technology
 
Specification Scala DSL for Mobile Application
Specification Scala DSL for Mobile ApplicationSpecification Scala DSL for Mobile Application
Specification Scala DSL for Mobile Application
 
Oracle ADF Quick Handy Reference
Oracle ADF Quick Handy ReferenceOracle ADF Quick Handy Reference
Oracle ADF Quick Handy Reference
 
Angular2 + rxjs
Angular2 + rxjsAngular2 + rxjs
Angular2 + rxjs
 
20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native20180518 QNAP Seminar - Introduction to React Native
20180518 QNAP Seminar - Introduction to React Native
 
Migrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UIMigrating a Large AEM Project to Touch UI
Migrating a Large AEM Project to Touch UI
 
React Lifecycle and Reconciliation
React Lifecycle and ReconciliationReact Lifecycle and Reconciliation
React Lifecycle and Reconciliation
 
Lab #2: Introduction to Javascript
Lab #2: Introduction to JavascriptLab #2: Introduction to Javascript
Lab #2: Introduction to Javascript
 
Android dev
Android devAndroid dev
Android dev
 
Advanced SharePoint Web Part Development
Advanced SharePoint Web Part DevelopmentAdvanced SharePoint Web Part Development
Advanced SharePoint Web Part Development
 
WinAppDriver Development
WinAppDriver DevelopmentWinAppDriver Development
WinAppDriver Development
 
Android Internals
Android InternalsAndroid Internals
Android Internals
 
React - Start learning today
React - Start learning today React - Start learning today
React - Start learning today
 
ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)ADF Gold Nuggets (Oracle Open World 2011)
ADF Gold Nuggets (Oracle Open World 2011)
 
Architecting Alive Apps
Architecting Alive AppsArchitecting Alive Apps
Architecting Alive Apps
 

Kürzlich hochgeladen

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 

Kürzlich hochgeladen (20)

DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

Adf component tech14

  • 2. About Us Richard Olrichs MN www.olrichs.nl @richardolrichs Wilfred van der Deijl The Future Group www.redheap.com @wilfreddeijl
  • 3. Agenda ● Live Demo Custom ADF Component ● How to use ● Deep dive code roundtrip ○ server side java, css, client side javascript ○ client and server events ● Lessons Learned
  • 4. Live Demo Custom ADF Component
  • 7. JSF Tag ● Facelets Tag (or JSP Tag for 11.1.1 and backwards compatibility)
  • 8. Let’s Build It Server Side https://github.com/wvanderdeijl/adfcomponent (=http://bit.ly/adfcomp)
  • 9. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent Server Side Client Side
  • 10.
  • 11. Facelets Tag Library - rh.taglib.xml Identifiers, not Java classes Component Attributes
  • 12. faces-config.xml - Faces Component Maps Component-Type identifier to implementing Component Java Class
  • 13. have ADF super classes do the heavy work holds all state key per attr returnType & defaultValue group of components that typically share a renderer
  • 14. Getters & Setters for component properties
  • 15. Component Class ● Server side instance ○ what MyBean gets via MyBean.setSelector() with binding=”#{myBean.selector}” ● Setters and Getters for all properties ● Internally keeps state in FacesBean with setProperty, getProperty ○ gives automatic state saving of JSF component tree between requests and on failover in cluster
  • 16. MultiSelect component setId, setValue, setItemSelectListener, setPartialTriggers Add custom rule to set from super class
  • 17. Facelets Handler Class ● Supplies rules to automap facelets tag attributes from XML file to component class properties ● Needed custom rule to support our ItemSelectListener attribute as Oracle’s ADF version only works for listeners from oracle. adf.view.rich package
  • 18. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 19. faces-config.xml - Renderer ComponentFamily and RendererType from component used to lookup RendererClass
  • 20. Which properties to expect from rendered component Find property keys once and describe client side props
  • 21. Start of the HTML component Add ADF skin Encode the Item <input type=”hidden” value=”[0,1,2]”/>
  • 22. render <li> for each item with <button> to select and <span> for delete
  • 23. Component selector pseudo selector style subclassing http://myfaces.apache.org/trinidad/devguide/skinning.html
  • 24. Apache Trinidad Content Compression On Off
  • 25. Component Renderer ● encodeAll method generates the HTML for the Component. ● ADF Skin (including compression) ○ more powerful than plain CSS ○ skinning properties for Renderer like -tr-open-animation- duration ○ relative colors: background-color: +#333333 ● Renderer lookup based on Family & RendererType from component ● Taglib custom tag can override RendererType and thus re-use same component with different Renderer
  • 26. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 27. Let’s Build It Client Side
  • 28. Client Side JavaScript Component Subclass from base ADF components Additional methods for client-side interaction with the component
  • 29. Server-side Renderer determines Client JavaScript Component
  • 30. ADF JavaScript Partitioning Dependency JS Client Constructor (defined by Renderer) ADF only downloads and runs needed JS core.js and any needed features
  • 31. Component Peer Class Creates the RhMultiSelectPeer Use client side ADFLogger Register this Peer to ClickEvent Register this RhMultiSelectPeer for RhMultiSelect component
  • 32. Best practice: assert for correct types Clicked delete icon DOM interaction Hidden input [0,1,2] ⇒ [0,2] Click button to select: Queue event to propagate to server
  • 33. Client Side Select Event [1/2] Call superclass initializer with our event name getters and setters for client side interaction with event
  • 34. Client Side Select Event [2/2] Queue event (called by Peer)
  • 35. Client Component RhMultiSelect.js ● Client-side representation of a server-side component ● Public client-side API ● Component state: Property container with support for event handling ● All ADF Faces JavaScript classes are prefixed with Adf to avoid naming conflicts with other JavaScript libraries
  • 36. Client Peer Object RhMultiSelectPeer.js Peer responsibilities: ● DOM initialization and cleanup ● DOM event handling ● Geometry management ● Partial page response handling ● Child visibility change handling ● Stateless private implementation
  • 37. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 38. Handle HTTP posts Server Side
  • 39. Renderer Incoming HTTP Post Detect submitted value set Component’s SubmittedValue
  • 40. Restore View Apply Request Values Process Validations Update Model Values Invoke Application Render Response JSF component’s “Local Value” written to ValueExpression eg. #{bindings.something.inputValue} SubmittedValue is converted to datatype of underlying model and stored in component’s “Local Value” Renderer invokes EditableValueHolder.setSubmittedValue() Invoke queued Listeners JSF Lifecycle Renderer uses SubmittedValue, “LocalValue” or “ModelValue”
  • 41. Renderer Incoming HTTP Post Queue server-side ItemSelectEvent when receiving client itemSelect event
  • 43. Managed Bean Event Listener
  • 44. Renderer - Wrap up ● Renderer decodeInternal() decodes the incoming http request ○ check if component value is submitted in this request. If so, pass on to JSF component ○ check for inbound events in the request
  • 45. Component FacesBean Skin Renderer Component Peer Event ItemSelectEvent
  • 47. Starting point (11.1.2.4) http://docs.oracle.com/cd/E37975_01/web.111240/e16181/ad_custom.htm#CHDJIEDB
  • 48. Documentation ● Full Github sample - http://bit.ly/adfcomp ● ADF Web User Interface Dev Guide 11.1.2.4 ○ 31 - Creating Custom ADF Faces Components ● ADF Web User Interface Dev Guide 12.1.3 ○ 4 - ADF Faces Client Side Architecture ○ Appendix A.2 - web.xml parameters ○ Appendix F.1.1 - adf-js-partitions.xml ● ADF Skin Editor Dev Guide 12.1.3 ● Apache Trinidad Skinning ● JSF 2.1 Reference Documentation ● ADF Source Code ○ available from Oracle Support
  • 51. JavaScript ● JavaScript libraries do not have namespaces, so prefix all JavaScript object names for the custom component using the same prefix. ● Place each JavaScript object in its own separate source file for best practice and consistency.
  • 52. Helpful stuff ● web.xml parameters ● Resource loading (zie: ImageResourceLoader) ● Toevoegen <method-signature> in de taglib voor het snappen van methodExpression. ●
  • 53. view1.jsf Tag Lib Skin faces-config Component FacesBean Renderer Handler Component Peer Event ItemSelectEvent
  • 54. Demo Shots Screen shots from the Demo