SlideShare ist ein Scribd-Unternehmen logo
1 von 15
MWLUG 2017
Moving Collaboration Forward
XPages/JSF ActionListeners
Look Who’s Listening
Slobodan Steve Lohja
MWLUG 2017
Moving Collaboration Forward
About Me
• Started with Notes 4.5 “Superhuman Software”
• One of the exam contributors for Domino 9 App Dev
• My blog uxdesign.xpagesbeast.com
• Modernizing apps with XPages and learning
Microservices and DevOps on Bluemix.
MWLUG 2017
Moving Collaboration Forward
More about me….
• A father of 2 adults, 1 toddler and one on the
way.
• I became a grandfather this year (2017).
• I prefer heavy metal.
• I am a advocate for the environment because
there is only one planet we can live in.
MWLUG 2017
Moving Collaboration Forward
JSF and XPages overview
• JSF (JavaServer Faces) is a proven industry
strength, tested, rock hard specification for a
UI application development framework.
• XPages is an extension of this framework.
• XPages can render out to the browser any
popular web libraries (HTML, CSS, Javascript).
• JSF was created to bring event driven
applications to the web.
MWLUG 2017
Moving Collaboration Forward
JSF Lifecyle Review
Faces Request
Restore
View
Apply Request
Values
Process
Events
Process Validations
Update Model
Values
Process
Events
Process
Events
Invoke Application
Process
Events
Render ResponseFaces Response
Request
Complete
Request
Complete
Request
Complete
Request
Complete
Render Response
Validation / Conversion Errors
Render Response
Validation / Conversion Errors
Render Response
MWLUG 2017
Moving Collaboration Forward
JSF Event Model
JSF inherits its event model from Swing or AWT
Java.util.EventObject
PhaseEvent
FacesEvent
ActionEvent
ValueChangeEvent
Package javax.faces.event
ValueHolder Components
Text, checkboxes
Use Value Change Listeners
Lifecyle Events
PhaseEvents
Use PhaseListners
Action Source Components
Button Link
Use Action Events
PhaseEvents are before
and after every Lifecycle
phase.
FacesEvents are fired in
the Invoke Application
Lifecyle phase.
ActionListeners are
executed befre action
events.
MWLUG 2017
Moving Collaboration Forward
JSF Event Model
• XPages extends the Event Model with a
EventHandler
• Actions is where you put real business logic.
• ActionListeners are prep work before the real
business logic.
• ActionListeners are Java classes that implement
the ActionListener interface or they are a method
in a managed bean.
• A single ActionListener can be called by many
Event Handlers for common prep tasks passing in
arguments.
MWLUG 2017
Moving Collaboration Forward
A use cases for ActionListeners
• Help reduce the amount of Custom Control artifacts by
sharing common patterns for create, edit, clone, and
delete.
Example: There is one dialog box to display a customer object.
The buttons/links that display the customer dialog are in a
context of an action. Edit Customer from a data table can call
a ActionListener to set the current Customer before displaying
the dialog box to Edit. Create Customer can clear the current
Customer before displaying the dialog box. If cloning,
ActionListener can do the Create process but also set the
customer number the user Intends to clone.
MWLUG 2017
Moving Collaboration Forward
ActionListener flow example
When viewing a data table, and your data entry is by dialog boxes, you
need a way to set what record your currently editing, cloning, or
deleting.
Data Table of objects
PageBean.customers
Create New
Edit | Clone | Delete
XPage - Customers
Customer Dialog (Edit/New)
PageBean.currentCustomer
X
OK
PageBean.java Life cyle
Submit
Cancel
Cancel
PageBean.java
Fields
Customer currentCustomer
List<Customer> customers
Behavior Methods that will be called by
ActionListeners
Public CreateCustomer()
Public deleteCustomer()
Public cloneCustomer()
Public editCustomer()
Public setCurrentCustomer()
Utility Methods
Public resetCurrentCustomer()
Data Methods
saveCustomer()
loadCustomers()
CustomerListener.java
Fields
none
ProcessAction
Use event arguments to
determine which
PageBean.method to call.
Initialize PageBean Load in Browser
Are you sure?
Delete
Yes
Dialogs launched in UI
ACTIONLISTENERWITHPARAMS
Events call ActionListner
pass parameters with
Intent
ActionListener preps for
up coming Intent.
onComplete, dialogs
loaded with data or
without. Depends on
Intent.
MWLUG 2017
Moving Collaboration Forward
Demo
MWLUG 2017
Moving Collaboration Forward
Debugging
Debugging with Domino Designer
MWLUG 2017
Moving Collaboration Forward
Debugging
• Bugs are a fact of life. There is no way around
it.
• Debugging is easier when they are at compile
time.
• Debugging runtime is harder, takes more time.
• Java is faster because you catch bugs at
compile time and IDE’s provide awesome
support for the language.
MWLUG 2017
Moving Collaboration Forward
Debugging
• Set notes.ini on your server, restart server.
• Configure a debugger in Domino Designer
• Set Break points
• Load application into your browser.
MWLUG 2017
Moving Collaboration Forward
Avoid bugs user generics
• Stronger type checks at compile time.
• We want to push all errors to compile time
bugs.
• Eliminate needs for casting. If casting, flag the
implementation is not best.
• Generic algorithms, working with data grid
items add,edit,delete,clone.
MWLUG 2017
Moving Collaboration Forward
Tips
• You cannot bind an List.size() because there is
no getter method.
• You can only pass strings to EventHandler
parameters, so rowIndex by itself will not
work. Use <xp:parameter name="rowIndex"
value="#{javascript:rowIndex}">

Weitere ähnliche Inhalte

Ähnlich wie JSF ActionListeners with XPages and Java Debugging XPages

Ajax Usability for AjaxWorld
Ajax Usability for AjaxWorldAjax Usability for AjaxWorld
Ajax Usability for AjaxWorldAndreCharland
 
Development and QA dilemmas in DevOps
Development and QA dilemmas in DevOpsDevelopment and QA dilemmas in DevOps
Development and QA dilemmas in DevOpsMatteo Emili
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Deliverymasoodjan
 
KiranGara_JEE_7Yrs
KiranGara_JEE_7YrsKiranGara_JEE_7Yrs
KiranGara_JEE_7YrsKiran Gara
 
Andy singleton continuous delivery-fcb - nov 2014
Andy singleton   continuous delivery-fcb - nov 2014Andy singleton   continuous delivery-fcb - nov 2014
Andy singleton continuous delivery-fcb - nov 2014Brad Power
 
Pruebas de rendimiento de Microsoft Dynamics NAV Whitepaper
Pruebas de rendimiento de Microsoft Dynamics NAV WhitepaperPruebas de rendimiento de Microsoft Dynamics NAV Whitepaper
Pruebas de rendimiento de Microsoft Dynamics NAV WhitepaperCLARA CAMPROVIN
 
Modern Application Development v1-0
Modern Application Development  v1-0Modern Application Development  v1-0
Modern Application Development v1-0Greg Hoelzer
 
WT Module-3.pptx
WT Module-3.pptxWT Module-3.pptx
WT Module-3.pptxRamyaH11
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadRuss Fustino
 
Gapand 2017 - Diseñando Arquitecturas Serverless en Azure
Gapand 2017 - Diseñando Arquitecturas Serverless en AzureGapand 2017 - Diseñando Arquitecturas Serverless en Azure
Gapand 2017 - Diseñando Arquitecturas Serverless en AzureAlberto Diaz Martin
 
Advanced Flow Techniques with Apex and Visualforce
Advanced Flow Techniques with Apex and VisualforceAdvanced Flow Techniques with Apex and Visualforce
Advanced Flow Techniques with Apex and VisualforceSalesforce Developers
 
IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6Strongback Consulting
 
The Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at PluralsightThe Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at PluralsightMike Clement
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistMark Fayngersh
 

Ähnlich wie JSF ActionListeners with XPages and Java Debugging XPages (20)

Ajax Usability for AjaxWorld
Ajax Usability for AjaxWorldAjax Usability for AjaxWorld
Ajax Usability for AjaxWorld
 
Development and QA dilemmas in DevOps
Development and QA dilemmas in DevOpsDevelopment and QA dilemmas in DevOps
Development and QA dilemmas in DevOps
 
ChaitraDS_updated
ChaitraDS_updatedChaitraDS_updated
ChaitraDS_updated
 
Bridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous DeliveryBridging the communication Gap & Continuous Delivery
Bridging the communication Gap & Continuous Delivery
 
Medicine For World
Medicine For WorldMedicine For World
Medicine For World
 
KiranGara_JEE_7Yrs
KiranGara_JEE_7YrsKiranGara_JEE_7Yrs
KiranGara_JEE_7Yrs
 
Andy singleton continuous delivery-fcb - nov 2014
Andy singleton   continuous delivery-fcb - nov 2014Andy singleton   continuous delivery-fcb - nov 2014
Andy singleton continuous delivery-fcb - nov 2014
 
Agile user story mapping
Agile user story mappingAgile user story mapping
Agile user story mapping
 
KATHY ZHANG_3
KATHY ZHANG_3KATHY ZHANG_3
KATHY ZHANG_3
 
Pruebas de rendimiento de Microsoft Dynamics NAV Whitepaper
Pruebas de rendimiento de Microsoft Dynamics NAV WhitepaperPruebas de rendimiento de Microsoft Dynamics NAV Whitepaper
Pruebas de rendimiento de Microsoft Dynamics NAV Whitepaper
 
VINOD_6yrs
VINOD_6yrsVINOD_6yrs
VINOD_6yrs
 
Tasvir_UI Developer
Tasvir_UI DeveloperTasvir_UI Developer
Tasvir_UI Developer
 
Modern Application Development v1-0
Modern Application Development  v1-0Modern Application Development  v1-0
Modern Application Development v1-0
 
WT Module-3.pptx
WT Module-3.pptxWT Module-3.pptx
WT Module-3.pptx
 
JavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) uploadJavaScript for ASP.NET programmers (webcast) upload
JavaScript for ASP.NET programmers (webcast) upload
 
Gapand 2017 - Diseñando Arquitecturas Serverless en Azure
Gapand 2017 - Diseñando Arquitecturas Serverless en AzureGapand 2017 - Diseñando Arquitecturas Serverless en Azure
Gapand 2017 - Diseñando Arquitecturas Serverless en Azure
 
Advanced Flow Techniques with Apex and Visualforce
Advanced Flow Techniques with Apex and VisualforceAdvanced Flow Techniques with Apex and Visualforce
Advanced Flow Techniques with Apex and Visualforce
 
IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6IBM Collaborative Lifecycle Management Solution for DevOps v6
IBM Collaborative Lifecycle Management Solution for DevOps v6
 
The Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at PluralsightThe Quest for Continuous Delivery at Pluralsight
The Quest for Continuous Delivery at Pluralsight
 
The State of Front-end At CrowdTwist
The State of Front-end At CrowdTwistThe State of Front-end At CrowdTwist
The State of Front-end At CrowdTwist
 

Mehr von Slobodan Lohja

Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Slobodan Lohja
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2Slobodan Lohja
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Slobodan Lohja
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2Slobodan Lohja
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1Slobodan Lohja
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes DesignerSlobodan Lohja
 

Mehr von Slobodan Lohja (7)

Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021Intro to SpringBatch NoSQL 2021
Intro to SpringBatch NoSQL 2021
 
Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)Enable Domino Data Access Services (DAS)
Enable Domino Data Access Services (DAS)
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 

Kürzlich hochgeladen

WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 

Kürzlich hochgeladen (20)

WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 

JSF ActionListeners with XPages and Java Debugging XPages

  • 1. MWLUG 2017 Moving Collaboration Forward XPages/JSF ActionListeners Look Who’s Listening Slobodan Steve Lohja
  • 2. MWLUG 2017 Moving Collaboration Forward About Me • Started with Notes 4.5 “Superhuman Software” • One of the exam contributors for Domino 9 App Dev • My blog uxdesign.xpagesbeast.com • Modernizing apps with XPages and learning Microservices and DevOps on Bluemix.
  • 3. MWLUG 2017 Moving Collaboration Forward More about me…. • A father of 2 adults, 1 toddler and one on the way. • I became a grandfather this year (2017). • I prefer heavy metal. • I am a advocate for the environment because there is only one planet we can live in.
  • 4. MWLUG 2017 Moving Collaboration Forward JSF and XPages overview • JSF (JavaServer Faces) is a proven industry strength, tested, rock hard specification for a UI application development framework. • XPages is an extension of this framework. • XPages can render out to the browser any popular web libraries (HTML, CSS, Javascript). • JSF was created to bring event driven applications to the web.
  • 5. MWLUG 2017 Moving Collaboration Forward JSF Lifecyle Review Faces Request Restore View Apply Request Values Process Events Process Validations Update Model Values Process Events Process Events Invoke Application Process Events Render ResponseFaces Response Request Complete Request Complete Request Complete Request Complete Render Response Validation / Conversion Errors Render Response Validation / Conversion Errors Render Response
  • 6. MWLUG 2017 Moving Collaboration Forward JSF Event Model JSF inherits its event model from Swing or AWT Java.util.EventObject PhaseEvent FacesEvent ActionEvent ValueChangeEvent Package javax.faces.event ValueHolder Components Text, checkboxes Use Value Change Listeners Lifecyle Events PhaseEvents Use PhaseListners Action Source Components Button Link Use Action Events PhaseEvents are before and after every Lifecycle phase. FacesEvents are fired in the Invoke Application Lifecyle phase. ActionListeners are executed befre action events.
  • 7. MWLUG 2017 Moving Collaboration Forward JSF Event Model • XPages extends the Event Model with a EventHandler • Actions is where you put real business logic. • ActionListeners are prep work before the real business logic. • ActionListeners are Java classes that implement the ActionListener interface or they are a method in a managed bean. • A single ActionListener can be called by many Event Handlers for common prep tasks passing in arguments.
  • 8. MWLUG 2017 Moving Collaboration Forward A use cases for ActionListeners • Help reduce the amount of Custom Control artifacts by sharing common patterns for create, edit, clone, and delete. Example: There is one dialog box to display a customer object. The buttons/links that display the customer dialog are in a context of an action. Edit Customer from a data table can call a ActionListener to set the current Customer before displaying the dialog box to Edit. Create Customer can clear the current Customer before displaying the dialog box. If cloning, ActionListener can do the Create process but also set the customer number the user Intends to clone.
  • 9. MWLUG 2017 Moving Collaboration Forward ActionListener flow example When viewing a data table, and your data entry is by dialog boxes, you need a way to set what record your currently editing, cloning, or deleting. Data Table of objects PageBean.customers Create New Edit | Clone | Delete XPage - Customers Customer Dialog (Edit/New) PageBean.currentCustomer X OK PageBean.java Life cyle Submit Cancel Cancel PageBean.java Fields Customer currentCustomer List<Customer> customers Behavior Methods that will be called by ActionListeners Public CreateCustomer() Public deleteCustomer() Public cloneCustomer() Public editCustomer() Public setCurrentCustomer() Utility Methods Public resetCurrentCustomer() Data Methods saveCustomer() loadCustomers() CustomerListener.java Fields none ProcessAction Use event arguments to determine which PageBean.method to call. Initialize PageBean Load in Browser Are you sure? Delete Yes Dialogs launched in UI ACTIONLISTENERWITHPARAMS Events call ActionListner pass parameters with Intent ActionListener preps for up coming Intent. onComplete, dialogs loaded with data or without. Depends on Intent.
  • 11. MWLUG 2017 Moving Collaboration Forward Debugging Debugging with Domino Designer
  • 12. MWLUG 2017 Moving Collaboration Forward Debugging • Bugs are a fact of life. There is no way around it. • Debugging is easier when they are at compile time. • Debugging runtime is harder, takes more time. • Java is faster because you catch bugs at compile time and IDE’s provide awesome support for the language.
  • 13. MWLUG 2017 Moving Collaboration Forward Debugging • Set notes.ini on your server, restart server. • Configure a debugger in Domino Designer • Set Break points • Load application into your browser.
  • 14. MWLUG 2017 Moving Collaboration Forward Avoid bugs user generics • Stronger type checks at compile time. • We want to push all errors to compile time bugs. • Eliminate needs for casting. If casting, flag the implementation is not best. • Generic algorithms, working with data grid items add,edit,delete,clone.
  • 15. MWLUG 2017 Moving Collaboration Forward Tips • You cannot bind an List.size() because there is no getter method. • You can only pass strings to EventHandler parameters, so rowIndex by itself will not work. Use <xp:parameter name="rowIndex" value="#{javascript:rowIndex}">

Hinweis der Redaktion

  1. Ask about audience, Number of XPages developers Number of classic domino developers Number of Java developers Number of Managers
  2. I grew up when the Big Four (Metallica, Slayer, Anthrax and Megadeath) were in their prime.
  3. Salesforce.com has adopted a new UI called Lightning. Lightning is an extension of JSF, the XPages skills you know are transferrable to Salesforce.com, but they limit more of what you can do in their XML markup. Oracle uses JSF for most of their business applications. Your Xpages skills are transferrable there. XPages extends this framework by creating cookie cutter UI components in Dojo, and Bootstrap. Using the framework, any type of web UI can be generated. JSF solves the no state issue between http requests by keeping an in memory representation of the page on the server.
  4. Restore view creates a server side tree representation of the UI. On Postbacks, the view is restored from disk. FacesContext is the object that contains the current View. Apply Request Values Updates the server side components with fresh data from the client by parsing the key/value pairs in the request. Two types of components ValueHolder text fields, checkboxes and ActionSource such as buttons and links. Note: Using the immediate attribute on a component alters the lifecyle. Immediate bypasses the validation and starts executing right away. Process Validations phase processes each UI Component in the tree in the sequential order. For each UI Component, values are converted to the data types they are supposed to be bound to. For example, a number input field comes in as text and gets converted to a double or integer. The the UI Components validation is processed. If any of these fail, you will get a error. Typically these state to look into the server log files and these logs cannot help you. What you need to do is set them to loaded = false and do trial and error until you find the bad binding. As a best practice, always put a <xp:messages /> tag on your page. Update Model Values updates the backend data models from the UI after validation. The UI Components are processed one at a time down the component tree. Bean properties that are bound to UI Components are set to the new values. Invoke application is responsible to do something with the data once it has been validated and model objects updated. Render Response Now we have reviewed the Lifecycle, lets dive into an ActionListener.
  5. For example, if a button is clicked, it would broadcast the event, and registered listeners will process the request.
  6. XPages did this to deliver ajax functionality so you do not have to create your own and blend it into the server side logic. For example, onComplete, onError, onStart, passing in arguments and partial refreshes.
  7. Cc_content_customer_table line 114 parameter example.