SlideShare a Scribd company logo
1 of 60
Download to read offline
Marty, You’re Just NotThinking Fourth Dimensionally
Dec. 13, 2016
This webinar is brought to you as part of the
free monthly webinar series from:
Howard Greenberg
@TLCC
Paul Della-Nebbia
@PaulDN
Courtney Carter
@Teamstudio
Paul Withers
@PaulSWithers
Teamstudio provides products that help
organizations with customized business
applications implement best practices, work
more efficiently, and prepare for the future.
AboutTeamstudio
Map a forward path for your IBM Notes and Domino
applications with comprehensive data analytics.
www.teamstudio.com/adviser
How can TLCC Help YOU!
1
• Private classes at
your location or
virtual
•XPages Development
•Support Existing Apps
•Administration
• Let us help you
become an expert
XPages developer!
• Delivered via Notes
• XPages
• Development
• Admin
• User
Self-
Paced
Courses
Mentoring
Instructor-
Led
Classes
Application
Development
and
Consulting
Free
Demo
Courses!
TLCC Development Services
• Let us help with your development needs
– Bootstrap
– Java
• Convert Notes Apps to mobile and the web!
• Modernize old Domino web applications
• Interface with backend data systems
• Skills transfer
2
Upcoming and Recorded Webinars
• Stay tuned!!!
www.tlcc.com/xpages-webinar
View Previous Webinars
(use url above)
Asking Questions – Q and A at the end
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions pane!
We will answer your questions
verbally at the end of the
webinar
5
Marty, You're Just Not Thinking Fourth
Dimensionally
Paul Withers
IBM Champion
Intec
@PaulSWithers
About Me
“My name is Darth Vader. I
am an extraterrestrial from
the planet Vulcan”
Why This Session?
• XPages often doesn’t work “as expected”
 Custom Control -> XPage -> Browser
 Browser -> Server -> Browser
 SSJS / CSJS
 State management
 Partial Refresh
• Lots of StackOverflow questions
 Which wouldn’t be referenced here unless many developers hit
the same issues!
Agenda
• Twin Pines Mall / Lone Pine Mall
• Marty’s Family Photo
• Marty McFly and the Tannens
• Power of Love
• Alternate 1985
• Indians!
• It’s Erased!
Twin Pines Mall / Lone
Pine Mall
Some Questions
• http://stackoverflow.com/questions/32256155/why-does-this-
code-write-out-two-documents/32259533#32259533
• http://stackoverflow.com/questions/24400934/xpages-save-
cancel-actions-scenario
• http://stackoverflow.com/questions/24407003/xpages-unid-of-
documents-why-it-is-changing
• http://stackoverflow.com/questions/21015953/xpages-conflict-
is-created-everytime-a-document-is-saved
• http://stackoverflow.com/questions/36013921/trying-to-open-
document-in-xpages
1. Retrieve/Create Code in documentId
• ALWAYS use ${…} when calculating properties like
documentId
• Otherwise calculated FOUR times on page load
 If attached to a Panel, TWICE AFTER beforePageLoad
 If attached to XPage, TWICE BEFORE beforePageLoad
• Can’t use scoped variables set in beforePageLoad!
 Always TWICE DURING render response
1a. Timing of Initialisations
• viewScoped variables can’t be set before PAGE LOAD
 Controller frameworks put variable in requestScope and move to
viewScope
• data, dataContexts etc
 attached to XPage / Custom Control - initialised alongside
component
 Attached to Panel – initialised during PAGE LOAD
2. ignoreRequestParams
• ALWAYS use ignoreRequestParams where appropriate
 If no params, computed settings respected
 If params passed, computed settings overwritten
3. Submit Button Type
• DON’T use save=“true” (“Submit” button type)
 Use script, not simple actions
• Greater control, less risk
• You save only what should be saved
• Preparing you for Java / beans / beyond
• Form with single rich text field can cause problems even with
script
Marty’s Family Photo
Some Questions
• http://stackoverflow.com/questions/33259105/xpages-button-
unresponsive-after-4-ajax-calls/33260337#33260337
• http://stackoverflow.com/questions/32628012/xpages-losing-a-
viewscoped-bean-again/32633453#32633453
• http://stackoverflow.com/questions/32482575/xpages-falling-
out-of-server-side-cache/32483154#32483154
• http://stackoverflow.com/questions/33686362/xpages-page-
loosing-context-weird-behaviour
• http://stackoverflow.com/questions/32628012/xpages-losing-a-
viewscoped-bean-again/32633453#32633453
4. Keep Pages In Memory
• XPages is stateful
• Number of component trees restricted for performance
• Dumped xsp.session.timeout minutes after browser closed
 Browser doesn’t tell server session is no longer used!
5. viewState=“nostate”
• viewState=“nostate”
 Don’t store a component tree for this page
 Best practice for XAgents / REST services
6. Explanation of “nostate”
• DataView and nostate
 Toggle expand/collapse is fine
 Navigating to specific pages is fine
 Next / Previous is relative to defaults
 Toggle detail is relative to defaults
• Unless detailsOnClient=“true”
• Details pushed to browser along with rest of content
• “Toggle” is client-side show/hide
Marty and the Tannens
Some Questions
• http://stackoverflow.com/questions/31561306/how-do-i-access-
a-repeat-control-from-the-outside-e-g-via-
csjs/31575723#31575723
• http://stackoverflow.com/questions/27982313/xprepeat-inside-
xedataview/27982614#27982614
• http://stackoverflow.com/questions/34158779/inherit-index-
from-repeatcontrol-in-nested-custom-
controls/34158954#34158954
• http://stackoverflow.com/questions/34652364/slider-in-repeat-
control-and-manipulation-of-text-via-
jouery/34653561#34653561
7. Repeat Controls and Component Tree
• Only one set of components in component tree
• repeatControls=“true” changes behaviour
 x many sets of components
 Hard-wired to specific entries at page load
 Pagers have no effect because of hard-wiring
 Allows “loaded” computations within the repeat, e.g. id’s
• Cannot compute repeatControls=“true” within compositeData
8. Dynamic Content Control
• Only components from current facet exist in component tree
• Component tree dynamically updated
• Better than showing / hiding via rendered property
9. Custom Controls and Scope
• Custom control is inserted into component tree
• Variable names outside custom control available
• As long as same variable used, no need to pass
• Same rules as for any component
 Is variable available by navigating upwards in tree?
 Cannot retrieve variables from another branch
• E.g. different repeat entry, repeat entry from outside repeat
Power of Love
ControllingViewHandler
• Creates component tree for specific XPage
• Runs before beforePageLoad event
• super.createView() loads component tree
• Also creates viewScope
 Not available before call to super.createView()
 Load variables to requestScope before super.createView()
 Move to viewScope after super.createView()
ControllingViewHandler
PhaseListener
• Handles XPages lifecycle
• On page load, only RENDER RESPONSE triggered
• Runs for every partial refresh
 Ensure optimised
 Ensure error handling
• Crucial for identifying why partial refresh is not behaving “as
expected”
PhaseListener
Some Questions
• http://stackoverflow.com/questions/20477153/xpages-server-
validation-errors-havent-been-displayed-to-the-user
• http://stackoverflow.com/questions/28339422/ssjs-onclick-
action-will-not-fire-on-xpage/28340759#28340759
• http://stackoverflow.com/questions/33024777/xpages-how-to-
do-partial-refresh-correctly
• http://www.intec.co.uk/view-isrenderingphase-and-buttons/
• http://www.intec.co.uk/fully-understanding-rendered-property-
and-components-with-events/
10. Understanding Partial Refresh
• Partial Refresh is SIX Phases
10. Understanding Partial Refresh
• 1. RESTORE VIEW
 Get component tree again
• 2. APPLY REQUEST VALUES
 Pass String values from browser to executed component tree
• 3. PROCESS VALIDATIONS
 Run validators AND converters for executed component tree
10. Understanding Partial Refresh
• 4. UPDATE MODEL VALUES
 Convert string values and update executed component tree
• 5. INVOKE APPLICATION
 Run application logic (SSJS / Java)
• 6. RENDER RESPONSE
 Update HTML for executed component tree and post refresh area
11. Conditionally Hidden Save Button
• Set rendered property on button
 For best practice, use view.isRenderingPhase()
 Ensure set to true for other phases or code will not run
• Add partial refresh where appropriate
 Ensure refresh area correct or button will not show
 Ensure disableValidators=“true” or button will not hide again if
invalid
12. Reasons Code May Not Work!
• CSJS returning false – check Firebug for POST event
• Conversion error – 1,2,3,6
• Validation error – 1,2,3,6
• Exec id not including components being used by application
logic
• Exec id not including component triggering application logic
• Event handler not rendered in phase 4
• Refresh area not including errors control
13. Troubleshooting
• Use PhaseListener
• java.util.logging.ConsoleHandler.level manages console
logging of server validation errors, since 8.5.3
 In workspace.configrcpinstall.properties
• ALWAYS including errors control in refresh area
• Be conscious of rendered property
BONUS 1: Data View
• dataCache=“id” setting available on View datasource
• Better for performance, only caches id, not full ViewEntry
(wrapped)
• “var” not available during Apply Request Values
 Compute value only in Render Response
BONUS 2 - Dialog
• To refresh area,
getComponent(“dialog1”).hide(“myRefreshArea”)
 POST
• Run SSJS
• view.postScript - XSP.closeDialog
 GET
• Refresh myRefreshArea
Alternate 1985
14. What Requires Restart Task HTTP?
• Picked up immediately
 Classic design elements
 XPages*
 Custom Controls*
 Java classes*
* Provided not in SCXD - http://www.intec.co.uk/single-copy-xpage-design-
some-learning-and-why-its-not-for-me/
14. What Requires Restart Task HTTP?
• Require “res task http”
 JAR files
• http://stackoverflow.com/questions/30939347/jar-file-changes-in-
lotus-notes-database-not-being-picked-up-by-domino-server
 SCXD
 OSGi plugin*
• http://stackoverflow.com/questions/33233724/while-in-development-
in-xpages-libraries-changes-are-not-picked-up/33234041#33234041
 Servlet / OSGi application*
* Without JRebel https://www.youtube.com/watch?v=EHbVgA2oqD0
Indians!
Question
• http://stackoverflow.com/questions/33190731/value-picker-get-
error-typeerror-resp-is-null-in-xpages/33210520#33210520
15. “Resp is null”
• Understand page load and dynamically
 “resp is null” – options for picker are not available
 Picker is client-side, but values are passed to renderer server-
side
16. SSJS in CSJS
• SSJS in CSJS
 Computed server-side as part of script renderer
 Only re-computed by partial refresh
• To access component values
 Use dojo.byId or variants to access client-side element
 Trigger partial refresh to update SSJS embedded into CSJS
It’s Erased!
Some Questions
• http://stackoverflow.com/questions/24735862/best-practice-for-
storing-datetime-values-in-xpages
• http://stackoverflow.com/questions/34417067/xpages-
notserializableexception-on-
datetime/34417335?noredirect=1#comment56612210_344173
35
• http://stackoverflow.com/questions/33168499/cannot-serialize-
javascript-function/33168732#33168732
17. Domino Objects in Scopes
• Domino objects can’t be stored in scopes.
 DateTimes are the most common culprit
 Use .toJavaDate() to store Java Date
• Similar issues with SSJS functions stored in variables
18. Impact of Persistence Setting
• For Domino objects in scopes, depending on persistence
setting
 Keep pages in memory – value just lost
 Keep pages on disk – error thrown to server, redirect to error
page (fails to display)
 Keep current page in memory – value just lost, error 500 on
navigating
Summary
• Understand ignoreRequestParams
• Avoid simple actions
• Keep Pages in Memory – understand impacts
• Use viewState=“nostate”
• Understand detailsOnClient=“true”
• Understand repeatControls=“true”
Summary
• Understand scope and custom controls
• Understand partial refresh is more than just “partial
refresh”
• Understand SSJS is computed and injected into CSJS
• Use Firebug or comparable tool
• Don’t store Domino objects in scopes
• Understand impact of serialization
Thank You!
Paul Withers
Intec Systems Ltd
IBM Champion
OpenNTF Board Member
@paulswithers
pwithers@intec.co.uk
http://www.intec.co.uk/blog
Questions????
Use the Orange Arrow button to
expand the GoToWebinar panel
Then ask your questions in the
Questions panel!
Remember, we will answer your
questions verbally
@PaulSWithers
@TLCCLtd
@Teamstudio
@PaulDN
Upcoming Events:
 Connect 2017 in San Francisco, CA – Feb. 20th to 23rd
 Engage in Antwerp Belgium, May 8th and 9th
Question and Answer Time!
Teamstudio Questions?
contactus@teamstudio.com
978-712-0924
TLCC Questions?
howardg@tlcc.com paul@tlcc.com
888-241-8522 or 561-953-0095
Howard Greenberg
Courtney Carter
Paul Della-Nebbia
Paul Withers
Intec

More Related Content

What's hot

What's hot (20)

XPages: No Experience Needed
XPages: No Experience NeededXPages: No Experience Needed
XPages: No Experience Needed
 
SmartNSF - 100% Smart - and in Color!
SmartNSF - 100% Smart - and in Color!SmartNSF - 100% Smart - and in Color!
SmartNSF - 100% Smart - and in Color!
 
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages ApplicationsIBM Connect 2016 - AD1548 - Building Responsive XPages Applications
IBM Connect 2016 - AD1548 - Building Responsive XPages Applications
 
Getting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino APIGetting Started with the OpenNTF Domino API
Getting Started with the OpenNTF Domino API
 
A Beard, An App, A Blender
A Beard, An App, A BlenderA Beard, An App, A Blender
A Beard, An App, A Blender
 
Presenting Data – An Alternative to the View Control
Presenting Data – An Alternative to the View ControlPresenting Data – An Alternative to the View Control
Presenting Data – An Alternative to the View Control
 
XPages Application Layout Control - TLCC March, 2014 Webinar
XPages Application Layout Control - TLCC March, 2014 WebinarXPages Application Layout Control - TLCC March, 2014 Webinar
XPages Application Layout Control - TLCC March, 2014 Webinar
 
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usabilityEngage - Expanding XPages with Bootstrap Plugins for ultimate usability
Engage - Expanding XPages with Bootstrap Plugins for ultimate usability
 
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
 
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
AD1279 "Marty, You're Not Thinking Fourth Dimensionally" - Troubleshooting XP...
 
AD1542 Get Hands On With Bluemix
AD1542 Get Hands On With BluemixAD1542 Get Hands On With Bluemix
AD1542 Get Hands On With Bluemix
 
[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics[DanNotes] XPages - Beyound the Basics
[DanNotes] XPages - Beyound the Basics
 
Transformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPagesTransformations: Smart Application Migration to XPages
Transformations: Smart Application Migration to XPages
 
Connect 2014 SHOW102: XPages Still No Experience Necessary
Connect 2014 SHOW102: XPages Still No Experience NecessaryConnect 2014 SHOW102: XPages Still No Experience Necessary
Connect 2014 SHOW102: XPages Still No Experience Necessary
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Go...
 
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
The Autobahn Has No Speed Limit - Your XPages Shouldn't Either!
 
IBM ConnectED 2015 - AD302 - Responsive Application Development for XPages
IBM ConnectED 2015 - AD302 - Responsive Application Development for XPagesIBM ConnectED 2015 - AD302 - Responsive Application Development for XPages
IBM ConnectED 2015 - AD302 - Responsive Application Development for XPages
 
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
Soccnx10: IBM Connections Troubleshooting or “Get the Cow off the Ice”
 
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
Biml for Beginners - Generating SSIS Packages with BimlScript (SQLSaturday Ex...
 

Viewers also liked

Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
Paul Fiore
 
The fork in the road - the Application Modernization Roadmap for Notes/Domin...
The fork in the road -  the Application Modernization Roadmap for Notes/Domin...The fork in the road -  the Application Modernization Roadmap for Notes/Domin...
The fork in the road - the Application Modernization Roadmap for Notes/Domin...
John Head
 

Viewers also liked (20)

IBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino RoadmapIBM Presents the IBM Notes and Domino Roadmap
IBM Presents the IBM Notes and Domino Roadmap
 
Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13Keynote apertura Dominopoint Days 2013, #dd13
Keynote apertura Dominopoint Days 2013, #dd13
 
IBM Connect 2017: Refresh and Extend IBM Domino Applications
IBM Connect 2017: Refresh and Extend IBM Domino ApplicationsIBM Connect 2017: Refresh and Extend IBM Domino Applications
IBM Connect 2017: Refresh and Extend IBM Domino Applications
 
Lotus Notes: Live Long and Prosper
Lotus Notes: Live Long and ProsperLotus Notes: Live Long and Prosper
Lotus Notes: Live Long and Prosper
 
Domino OSGi Development
Domino OSGi DevelopmentDomino OSGi Development
Domino OSGi Development
 
The fork in the road - the Application Modernization Roadmap for Notes/Domin...
The fork in the road -  the Application Modernization Roadmap for Notes/Domin...The fork in the road -  the Application Modernization Roadmap for Notes/Domin...
The fork in the road - the Application Modernization Roadmap for Notes/Domin...
 
A World Without Applications
A World Without ApplicationsA World Without Applications
A World Without Applications
 
Beyond XPages
Beyond XPagesBeyond XPages
Beyond XPages
 
IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...
IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...
IBM Connect 2014 - AD205: Creating State-of-the-Art Web Applications with Dom...
 
Optimus XPages Part 2: The Deep Dive
Optimus XPages Part 2: The Deep DiveOptimus XPages Part 2: The Deep Dive
Optimus XPages Part 2: The Deep Dive
 
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)Get the best out of Bootstrap with Bootstrap4XPages (AD202)
Get the best out of Bootstrap with Bootstrap4XPages (AD202)
 
Meetit16 KeyNote di Apertura
Meetit16 KeyNote di AperturaMeetit16 KeyNote di Apertura
Meetit16 KeyNote di Apertura
 
One Firm's Wild Ride to The Cloud
One Firm's Wild Ride to The CloudOne Firm's Wild Ride to The Cloud
One Firm's Wild Ride to The Cloud
 
IBM Social Business Journey and IBM Verse / cloud collaboration #MWLUG2015
IBM Social Business Journey and IBM Verse / cloud collaboration #MWLUG2015IBM Social Business Journey and IBM Verse / cloud collaboration #MWLUG2015
IBM Social Business Journey and IBM Verse / cloud collaboration #MWLUG2015
 
IBM Connect 2017 - Beyond Domino Designer
IBM Connect 2017 - Beyond Domino DesignerIBM Connect 2017 - Beyond Domino Designer
IBM Connect 2017 - Beyond Domino Designer
 
Angular.js in XPages
Angular.js in XPagesAngular.js in XPages
Angular.js in XPages
 
Partitioning IBM Connections Cloud Administration
Partitioning IBM Connections Cloud AdministrationPartitioning IBM Connections Cloud Administration
Partitioning IBM Connections Cloud Administration
 
The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...The future of web development write once, run everywhere with angular.js and ...
The future of web development write once, run everywhere with angular.js and ...
 
What’s New and Coming in IBM Connections
What’s New and Coming in IBM ConnectionsWhat’s New and Coming in IBM Connections
What’s New and Coming in IBM Connections
 
Benefits and Risks of a Single Identity - IBM Connect 2017
Benefits and Risks of a Single Identity - IBM Connect 2017Benefits and Risks of a Single Identity - IBM Connect 2017
Benefits and Risks of a Single Identity - IBM Connect 2017
 

Similar to Marty, You're Just Not Thinking Fourth Dimensionally

SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
Ben Steinhauser
 

Similar to Marty, You're Just Not Thinking Fourth Dimensionally (20)

Salesforce Lightning Process builder
Salesforce Lightning Process builderSalesforce Lightning Process builder
Salesforce Lightning Process builder
 
LDV.pptx
LDV.pptxLDV.pptx
LDV.pptx
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
Creating a Great XPages User Interface
Creating a Great XPages User InterfaceCreating a Great XPages User Interface
Creating a Great XPages User Interface
 
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
 
QA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integrationQA Team Goes to Agile and Continuous integration
QA Team Goes to Agile and Continuous integration
 
Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0Product Information - Fuse Management Central 1.0.0
Product Information - Fuse Management Central 1.0.0
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
SCRIMPS-STD: Test Automation Design Principles - and asking the right questions!
 
Data harmony update 2021
Data harmony update 2021 Data harmony update 2021
Data harmony update 2021
 
Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!Single Page Applications: Your Browser is the OS!
Single Page Applications: Your Browser is the OS!
 
Where to save my data, for devs!
Where to save my data, for devs!Where to save my data, for devs!
Where to save my data, for devs!
 
Agile Secure Cloud Application Development Management
Agile Secure Cloud Application Development ManagementAgile Secure Cloud Application Development Management
Agile Secure Cloud Application Development Management
 
Magento performance feat. core Hacks
Magento performance feat. core HacksMagento performance feat. core Hacks
Magento performance feat. core Hacks
 
Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4Server and application monitoring webinars [Applications Manager] - Part 4
Server and application monitoring webinars [Applications Manager] - Part 4
 
Opticon18: Developer Night
Opticon18: Developer NightOpticon18: Developer Night
Opticon18: Developer Night
 
Best Practices for Building WordPress Applications
Best Practices for Building WordPress ApplicationsBest Practices for Building WordPress Applications
Best Practices for Building WordPress Applications
 
Enhanced Reframework Session_16-07-2022.pptx
Enhanced Reframework Session_16-07-2022.pptxEnhanced Reframework Session_16-07-2022.pptx
Enhanced Reframework Session_16-07-2022.pptx
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
 
Datastage Introduction To Data Warehousing
Datastage Introduction To Data WarehousingDatastage Introduction To Data Warehousing
Datastage Introduction To Data Warehousing
 

More from Teamstudio

Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControls
Teamstudio
 

More from Teamstudio (16)

Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Search Terms and Design Complexity: A Tutorial Before Modernizing or MigratingSearch Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
Search Terms and Design Complexity: A Tutorial Before Modernizing or Migrating
 
Understand Usage with Detailed Access Information
Understand Usage with Detailed Access InformationUnderstand Usage with Detailed Access Information
Understand Usage with Detailed Access Information
 
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
Take a Trip Into the Forest: A Java Primer on Maps, Trees, and Collections
 
Understand the True Business Usage of Notes Applications with Usage Auditor
Understand the True Business Usage of Notes Applications with Usage AuditorUnderstand the True Business Usage of Notes Applications with Usage Auditor
Understand the True Business Usage of Notes Applications with Usage Auditor
 
Ask the XPages Experts
Ask the XPages ExpertsAsk the XPages Experts
Ask the XPages Experts
 
Everything XControls
Everything XControlsEverything XControls
Everything XControls
 
An Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller PatternAn Introduction to the Model-View-Controller Pattern
An Introduction to the Model-View-Controller Pattern
 
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
Mobilisez vos Applications IBM Notes avec Teamstudio Unplugged ! (French Lang...
 
Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?Domino, Notes, and Verse - Where are We and Whats the Future?
Domino, Notes, and Verse - Where are We and Whats the Future?
 
App.Next - The Future of Domino Application Development
App.Next - The Future of Domino Application DevelopmentApp.Next - The Future of Domino Application Development
App.Next - The Future of Domino Application Development
 
A Notes Developer's Journey into Java
A Notes Developer's Journey into JavaA Notes Developer's Journey into Java
A Notes Developer's Journey into Java
 
Mobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an AppMobilize Your Business, Not Just an App
Mobilize Your Business, Not Just an App
 
Tips for Building your First XPages Java Application
Tips for Building your First XPages Java ApplicationTips for Building your First XPages Java Application
Tips for Building your First XPages Java Application
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Wireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControlsWireless Wednesdays: Introduction to XControls
Wireless Wednesdays: Introduction to XControls
 
The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1The XPages Mobile Controls: What's New in Notes 9.0.1
The XPages Mobile Controls: What's New in Notes 9.0.1
 

Recently uploaded

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 

Recently uploaded (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 

Marty, You're Just Not Thinking Fourth Dimensionally

  • 1. Marty, You’re Just NotThinking Fourth Dimensionally Dec. 13, 2016
  • 2. This webinar is brought to you as part of the free monthly webinar series from:
  • 3. Howard Greenberg @TLCC Paul Della-Nebbia @PaulDN Courtney Carter @Teamstudio Paul Withers @PaulSWithers
  • 4. Teamstudio provides products that help organizations with customized business applications implement best practices, work more efficiently, and prepare for the future. AboutTeamstudio
  • 5. Map a forward path for your IBM Notes and Domino applications with comprehensive data analytics.
  • 7. How can TLCC Help YOU! 1 • Private classes at your location or virtual •XPages Development •Support Existing Apps •Administration • Let us help you become an expert XPages developer! • Delivered via Notes • XPages • Development • Admin • User Self- Paced Courses Mentoring Instructor- Led Classes Application Development and Consulting Free Demo Courses!
  • 8. TLCC Development Services • Let us help with your development needs – Bootstrap – Java • Convert Notes Apps to mobile and the web! • Modernize old Domino web applications • Interface with backend data systems • Skills transfer 2
  • 9. Upcoming and Recorded Webinars • Stay tuned!!! www.tlcc.com/xpages-webinar View Previous Webinars (use url above)
  • 10. Asking Questions – Q and A at the end Use the Orange Arrow button to expand the GoToWebinar panel Then ask your questions in the Questions pane! We will answer your questions verbally at the end of the webinar
  • 11. 5 Marty, You're Just Not Thinking Fourth Dimensionally Paul Withers IBM Champion Intec @PaulSWithers
  • 12. About Me “My name is Darth Vader. I am an extraterrestrial from the planet Vulcan”
  • 13. Why This Session? • XPages often doesn’t work “as expected”  Custom Control -> XPage -> Browser  Browser -> Server -> Browser  SSJS / CSJS  State management  Partial Refresh • Lots of StackOverflow questions  Which wouldn’t be referenced here unless many developers hit the same issues!
  • 14. Agenda • Twin Pines Mall / Lone Pine Mall • Marty’s Family Photo • Marty McFly and the Tannens • Power of Love • Alternate 1985 • Indians! • It’s Erased!
  • 15. Twin Pines Mall / Lone Pine Mall
  • 16. Some Questions • http://stackoverflow.com/questions/32256155/why-does-this- code-write-out-two-documents/32259533#32259533 • http://stackoverflow.com/questions/24400934/xpages-save- cancel-actions-scenario • http://stackoverflow.com/questions/24407003/xpages-unid-of- documents-why-it-is-changing • http://stackoverflow.com/questions/21015953/xpages-conflict- is-created-everytime-a-document-is-saved • http://stackoverflow.com/questions/36013921/trying-to-open- document-in-xpages
  • 17. 1. Retrieve/Create Code in documentId • ALWAYS use ${…} when calculating properties like documentId • Otherwise calculated FOUR times on page load  If attached to a Panel, TWICE AFTER beforePageLoad  If attached to XPage, TWICE BEFORE beforePageLoad • Can’t use scoped variables set in beforePageLoad!  Always TWICE DURING render response
  • 18. 1a. Timing of Initialisations • viewScoped variables can’t be set before PAGE LOAD  Controller frameworks put variable in requestScope and move to viewScope • data, dataContexts etc  attached to XPage / Custom Control - initialised alongside component  Attached to Panel – initialised during PAGE LOAD
  • 19. 2. ignoreRequestParams • ALWAYS use ignoreRequestParams where appropriate  If no params, computed settings respected  If params passed, computed settings overwritten
  • 20. 3. Submit Button Type • DON’T use save=“true” (“Submit” button type)  Use script, not simple actions • Greater control, less risk • You save only what should be saved • Preparing you for Java / beans / beyond • Form with single rich text field can cause problems even with script
  • 22. Some Questions • http://stackoverflow.com/questions/33259105/xpages-button- unresponsive-after-4-ajax-calls/33260337#33260337 • http://stackoverflow.com/questions/32628012/xpages-losing-a- viewscoped-bean-again/32633453#32633453 • http://stackoverflow.com/questions/32482575/xpages-falling- out-of-server-side-cache/32483154#32483154 • http://stackoverflow.com/questions/33686362/xpages-page- loosing-context-weird-behaviour • http://stackoverflow.com/questions/32628012/xpages-losing-a- viewscoped-bean-again/32633453#32633453
  • 23. 4. Keep Pages In Memory • XPages is stateful • Number of component trees restricted for performance • Dumped xsp.session.timeout minutes after browser closed  Browser doesn’t tell server session is no longer used!
  • 24. 5. viewState=“nostate” • viewState=“nostate”  Don’t store a component tree for this page  Best practice for XAgents / REST services
  • 25. 6. Explanation of “nostate” • DataView and nostate  Toggle expand/collapse is fine  Navigating to specific pages is fine  Next / Previous is relative to defaults  Toggle detail is relative to defaults • Unless detailsOnClient=“true” • Details pushed to browser along with rest of content • “Toggle” is client-side show/hide
  • 26. Marty and the Tannens
  • 27. Some Questions • http://stackoverflow.com/questions/31561306/how-do-i-access- a-repeat-control-from-the-outside-e-g-via- csjs/31575723#31575723 • http://stackoverflow.com/questions/27982313/xprepeat-inside- xedataview/27982614#27982614 • http://stackoverflow.com/questions/34158779/inherit-index- from-repeatcontrol-in-nested-custom- controls/34158954#34158954 • http://stackoverflow.com/questions/34652364/slider-in-repeat- control-and-manipulation-of-text-via- jouery/34653561#34653561
  • 28. 7. Repeat Controls and Component Tree • Only one set of components in component tree • repeatControls=“true” changes behaviour  x many sets of components  Hard-wired to specific entries at page load  Pagers have no effect because of hard-wiring  Allows “loaded” computations within the repeat, e.g. id’s • Cannot compute repeatControls=“true” within compositeData
  • 29. 8. Dynamic Content Control • Only components from current facet exist in component tree • Component tree dynamically updated • Better than showing / hiding via rendered property
  • 30. 9. Custom Controls and Scope • Custom control is inserted into component tree • Variable names outside custom control available • As long as same variable used, no need to pass • Same rules as for any component  Is variable available by navigating upwards in tree?  Cannot retrieve variables from another branch • E.g. different repeat entry, repeat entry from outside repeat
  • 32. ControllingViewHandler • Creates component tree for specific XPage • Runs before beforePageLoad event • super.createView() loads component tree • Also creates viewScope  Not available before call to super.createView()  Load variables to requestScope before super.createView()  Move to viewScope after super.createView()
  • 34. PhaseListener • Handles XPages lifecycle • On page load, only RENDER RESPONSE triggered • Runs for every partial refresh  Ensure optimised  Ensure error handling • Crucial for identifying why partial refresh is not behaving “as expected”
  • 36. Some Questions • http://stackoverflow.com/questions/20477153/xpages-server- validation-errors-havent-been-displayed-to-the-user • http://stackoverflow.com/questions/28339422/ssjs-onclick- action-will-not-fire-on-xpage/28340759#28340759 • http://stackoverflow.com/questions/33024777/xpages-how-to- do-partial-refresh-correctly • http://www.intec.co.uk/view-isrenderingphase-and-buttons/ • http://www.intec.co.uk/fully-understanding-rendered-property- and-components-with-events/
  • 37. 10. Understanding Partial Refresh • Partial Refresh is SIX Phases
  • 38. 10. Understanding Partial Refresh • 1. RESTORE VIEW  Get component tree again • 2. APPLY REQUEST VALUES  Pass String values from browser to executed component tree • 3. PROCESS VALIDATIONS  Run validators AND converters for executed component tree
  • 39. 10. Understanding Partial Refresh • 4. UPDATE MODEL VALUES  Convert string values and update executed component tree • 5. INVOKE APPLICATION  Run application logic (SSJS / Java) • 6. RENDER RESPONSE  Update HTML for executed component tree and post refresh area
  • 40. 11. Conditionally Hidden Save Button • Set rendered property on button  For best practice, use view.isRenderingPhase()  Ensure set to true for other phases or code will not run • Add partial refresh where appropriate  Ensure refresh area correct or button will not show  Ensure disableValidators=“true” or button will not hide again if invalid
  • 41. 12. Reasons Code May Not Work! • CSJS returning false – check Firebug for POST event • Conversion error – 1,2,3,6 • Validation error – 1,2,3,6 • Exec id not including components being used by application logic • Exec id not including component triggering application logic • Event handler not rendered in phase 4 • Refresh area not including errors control
  • 42. 13. Troubleshooting • Use PhaseListener • java.util.logging.ConsoleHandler.level manages console logging of server validation errors, since 8.5.3  In workspace.configrcpinstall.properties • ALWAYS including errors control in refresh area • Be conscious of rendered property
  • 43. BONUS 1: Data View • dataCache=“id” setting available on View datasource • Better for performance, only caches id, not full ViewEntry (wrapped) • “var” not available during Apply Request Values  Compute value only in Render Response
  • 44. BONUS 2 - Dialog • To refresh area, getComponent(“dialog1”).hide(“myRefreshArea”)  POST • Run SSJS • view.postScript - XSP.closeDialog  GET • Refresh myRefreshArea
  • 46. 14. What Requires Restart Task HTTP? • Picked up immediately  Classic design elements  XPages*  Custom Controls*  Java classes* * Provided not in SCXD - http://www.intec.co.uk/single-copy-xpage-design- some-learning-and-why-its-not-for-me/
  • 47. 14. What Requires Restart Task HTTP? • Require “res task http”  JAR files • http://stackoverflow.com/questions/30939347/jar-file-changes-in- lotus-notes-database-not-being-picked-up-by-domino-server  SCXD  OSGi plugin* • http://stackoverflow.com/questions/33233724/while-in-development- in-xpages-libraries-changes-are-not-picked-up/33234041#33234041  Servlet / OSGi application* * Without JRebel https://www.youtube.com/watch?v=EHbVgA2oqD0
  • 50. 15. “Resp is null” • Understand page load and dynamically  “resp is null” – options for picker are not available  Picker is client-side, but values are passed to renderer server- side
  • 51. 16. SSJS in CSJS • SSJS in CSJS  Computed server-side as part of script renderer  Only re-computed by partial refresh • To access component values  Use dojo.byId or variants to access client-side element  Trigger partial refresh to update SSJS embedded into CSJS
  • 53. Some Questions • http://stackoverflow.com/questions/24735862/best-practice-for- storing-datetime-values-in-xpages • http://stackoverflow.com/questions/34417067/xpages- notserializableexception-on- datetime/34417335?noredirect=1#comment56612210_344173 35 • http://stackoverflow.com/questions/33168499/cannot-serialize- javascript-function/33168732#33168732
  • 54. 17. Domino Objects in Scopes • Domino objects can’t be stored in scopes.  DateTimes are the most common culprit  Use .toJavaDate() to store Java Date • Similar issues with SSJS functions stored in variables
  • 55. 18. Impact of Persistence Setting • For Domino objects in scopes, depending on persistence setting  Keep pages in memory – value just lost  Keep pages on disk – error thrown to server, redirect to error page (fails to display)  Keep current page in memory – value just lost, error 500 on navigating
  • 56. Summary • Understand ignoreRequestParams • Avoid simple actions • Keep Pages in Memory – understand impacts • Use viewState=“nostate” • Understand detailsOnClient=“true” • Understand repeatControls=“true”
  • 57. Summary • Understand scope and custom controls • Understand partial refresh is more than just “partial refresh” • Understand SSJS is computed and injected into CSJS • Use Firebug or comparable tool • Don’t store Domino objects in scopes • Understand impact of serialization
  • 58. Thank You! Paul Withers Intec Systems Ltd IBM Champion OpenNTF Board Member @paulswithers pwithers@intec.co.uk http://www.intec.co.uk/blog
  • 59. Questions???? Use the Orange Arrow button to expand the GoToWebinar panel Then ask your questions in the Questions panel! Remember, we will answer your questions verbally
  • 60. @PaulSWithers @TLCCLtd @Teamstudio @PaulDN Upcoming Events:  Connect 2017 in San Francisco, CA – Feb. 20th to 23rd  Engage in Antwerp Belgium, May 8th and 9th Question and Answer Time! Teamstudio Questions? contactus@teamstudio.com 978-712-0924 TLCC Questions? howardg@tlcc.com paul@tlcc.com 888-241-8522 or 561-953-0095 Howard Greenberg Courtney Carter Paul Della-Nebbia Paul Withers Intec