SlideShare a Scribd company logo
xPages Example:  Binding to multiple datasources on a single xPage Author: John Mackey Groupware Solutions Inc. J [email_address] Blog:  http://www.jmackey.net
Overview Unlike Lotus Notes, xPages separates the presentation layer from the data  This presents new opportunities and allows different approaches for Web application development xPages allows multiple datasources on the same page A simple action “Save Datasources” handles the updates for all bound datasources
Bound to Order Form Bound to Customer Form Sample Screen shot of Orders page
First Step:  Create your Notes forms - schema To get started you need to define your forms and fields This is not required but the xPages IDE will not be able to provide you with drop down fields and you will not be able to drag and drop from the Data Palette, so it is beneficial to create a form. Here is the layout for the 2 forms:
Create your views There are 2 standard views: Customers & Orders Note: column 5 on the customers view uses @NoteID.  That will be used to bind the Customer document in the Panel control.  You have to strip out the “NT” prefix. Customers Orders
Create the Customer xPage Create a new xPage named “Customers” Set the Data Source Click Data from the Properties tab Click the Add button and select “Domino Document” Then select the form
Create the Customer xPage (cont.) Next click on the Data palette link (this is cool!) Note: I noticed sometimes you need to click someplace on the form first before the Data Palette shows the fields Select all the fields and drag them to the page canvas.  You can rearrange or change them later This will automatically create edit box controls in a table and setup the proper bindings
Create the Orders xPage Follow the same basic steps from the Customer Page Create the new xPage named “Orders” Set the datasource Drag drop the fields Replace the “CustomerName” edit box control with a combobox control re-bind it to the CustomerName from the Data properties tab Click on the Values tab and add a Formula item: @DbColumn(@DbName(),"vCustomers",1)
Create the Orders xPage (cont) Add a default label of “--select--” with a value of 0  use the “Up” arrows to position it as the first element
Create the Orders xPage (cont) Drag a Panel control to the page – this is where we bind the customer data to the xPage Name it “CustomerData” Click on the Data tab for the panel and create a new Domino Document datasource named “customerDoc”, the form is “Customer”, the action is “Edit document”
Create the Orders xPage (cont) We need to supply a document Id for the customer record Note: xPages use the document NoteId We will grab the NoteId from a lookup to the vCustomers view Click on the “Document ID” formula and enter the following Computed formula
Create the Orders xPage (cont) Add the Customer fields to the Panel Click on the Data palette link Drag and drop the fields you want to the Panel Note: I replaced the ShippingInstructions with a   Multi-line editbox in the below example
Create the Orders xPage (cont) We need to set a property on the Panel control so that the Panel ignores any request parameters for the Orders page.   For example: the page receives and uses parameters such as “editDocument” and “documentID”.  For this use case we calculate the documentID for the Panel and so we want to ignore the page parameters. Click on the All Properties on the Properties tab for the  “CustomerData”  Panel Expand Data and set “ignoreRequestParams” to true
Create the Orders xPage (cont) We need to make the page refresh when the Customer Name changes in the combobox Select the CustomerName combobox Select the Events tab and then the onChange event Include the following formula
Create the View xPage You will need to create a view page for navigation  Create a new xPage named “ViewCustomers” Drag a Tabbed control to the page Create 2 tabs (right click – insert tab) Name one “Customers”, the other “Orders” Drag a view control to the Customer tab Select your vCustomers view as the source Do the same for Orders and select the vOrders view as the source
Create the View xPage (contd.) Make the first column a link Select the CustomerName column and set the link property Also, select the view and set the “open selected documents using”  property on the data tab Do the same steps for the Orders view Link property Form to use
Create the View xPage (contd.) Create 2 buttons so you can add Customers and Orders Drag a button Use the following simple action (substitute for Orders)
Final Steps Add the save buttons to the Orders & Customers page Drag a button Select “Simple action” – Save Data Sources Select the “ViewCustomers” page to open next Set the default xPage to open for the database on the database properties launch tab
Test the Application Create some Customers Create some Orders and change the Customer information from the Orders page Navigate to the Customer’s page and verify the Customer information was updated when the save occurred
Questions?? Contact me if you have any questions [email_address] or comment on my blog:  http://www.jmackey.net The Domino 8.5 discussion forum is: http://www-10.lotus.com/ldd/nd85forum.nsf

More Related Content

PPTX
Netcat - A Swiss Army Tool
PPTX
Introduction to JavaScript Basics.
PPTX
Basic of PHP
PPSX
Introduction to Html5
PPTX
Html5 tutorial for beginners
PDF
Specification-By-Example with Gherkin
PDF
Offzone | Another waf bypass
PDF
Windows IOCP vs Linux EPOLL Performance Comparison
Netcat - A Swiss Army Tool
Introduction to JavaScript Basics.
Basic of PHP
Introduction to Html5
Html5 tutorial for beginners
Specification-By-Example with Gherkin
Offzone | Another waf bypass
Windows IOCP vs Linux EPOLL Performance Comparison

What's hot (20)

PPTX
Implicit object.pptx
PPT
GCGC- CGCII 서버 엔진에 적용된 기술 (5) - Executor with Exception
PPT
Introduction to Javascript
PDF
2. HTML forms
PDF
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
PPT
Introduction to CSS Borders - Lesson 4
PDF
MiXiT - Numérique responsable, ouvrons le capot des fournisseurs Cloud
PDF
Building Advanced XSS Vectors
PPT
javascript-basics.ppt
PDF
Lets make a better react form
PPTX
HTML Semantic Elements
PDF
Session1-Introduce Http-HTTP Security headers
PPTX
Reflective and Stored XSS- Cross Site Scripting
PDF
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
PDF
프로그래밍 대회: C++11 이야기
PDF
Mobile Browser Internal (Blink Rendering Engine)
PDF
Ruby on Rails Presentation
PPT
PDF
Callback Function
PPTX
Attacking thru HTTP Host header
Implicit object.pptx
GCGC- CGCII 서버 엔진에 적용된 기술 (5) - Executor with Exception
Introduction to Javascript
2. HTML forms
How to steal and modify data using Business Logic flaws - Insecure Direct Obj...
Introduction to CSS Borders - Lesson 4
MiXiT - Numérique responsable, ouvrons le capot des fournisseurs Cloud
Building Advanced XSS Vectors
javascript-basics.ppt
Lets make a better react form
HTML Semantic Elements
Session1-Introduce Http-HTTP Security headers
Reflective and Stored XSS- Cross Site Scripting
OWASP AppSecEU 2018 – Attacking "Modern" Web Technologies
프로그래밍 대회: C++11 이야기
Mobile Browser Internal (Blink Rendering Engine)
Ruby on Rails Presentation
Callback Function
Attacking thru HTTP Host header
Ad

Similar to Binding to multiple datasources on a single xPage (20)

PDF
Ask the XPages Experts
ODP
IBM Lotus Notes Domino XPages and XPages for Mobile
PDF
OpenNTF Webinar, October 2020
PDF
Creating a Great XPages User Interface
PDF
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
PDF
Harness the power of XPages in Lotus Domino
DOCX
PDF
Connect 2014 - JMP102: Creating a Great XPages User Interface
PPT
XPages Workshop: Concepts And Exercises
PDF
Just the Facets, Ma'am
KEY
WPF: Working with Data
PDF
Ad107 - Enhance Your Existing Applications with XPages
PPT
AD303: Extreme Makeover – IBM® Lotus® Domino® Application Edition
PDF
Learning to run
PDF
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
ODP
Supersize me
PDF
Wireless Wednesdays: Part 2
PDF
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
PDF
Presenting Data – An Alternative to the View Control
Ask the XPages Experts
IBM Lotus Notes Domino XPages and XPages for Mobile
OpenNTF Webinar, October 2020
Creating a Great XPages User Interface
Creating a Great XPages User Interface, TLCC Teamstudio Webinar - Feb, 2014
Harness the power of XPages in Lotus Domino
Connect 2014 - JMP102: Creating a Great XPages User Interface
XPages Workshop: Concepts And Exercises
Just the Facets, Ma'am
WPF: Working with Data
Ad107 - Enhance Your Existing Applications with XPages
AD303: Extreme Makeover – IBM® Lotus® Domino® Application Edition
Learning to run
XPages and jQuery DataTables: Simplifying View Creation while Maximizing Func...
Supersize me
Wireless Wednesdays: Part 2
SHOW102 XPages: Still No Experience Necessary IBM Connect 2014
Presenting Data – An Alternative to the View Control
Ad

More from dominion (20)

PDF
What is a itil and how does it relate to your collaborative environment uklug
PDF
iOS enterprise
PDF
cloud session uklug
ODP
Uklug 2011 administrator development synergy
PDF
Uklug 2011 client management
PDF
JavaScript blast
PDF
Populating your domino directory or any domino database with tivoli directory...
ODP
Uklug2011 Know your Notes
ODP
Quickr
ODP
Taking themes to the next level
ODP
Aussie outback
PPT
Implementing xpages extension library
PDF
Abb presentation uklug
PDF
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
PPT
Domino testing presentation
PDF
Composite applications tutorial
PDF
Maximizing application performance
PDF
Error handling in XPages
PPT
wcm domino
PPT
leverage dxl
What is a itil and how does it relate to your collaborative environment uklug
iOS enterprise
cloud session uklug
Uklug 2011 administrator development synergy
Uklug 2011 client management
JavaScript blast
Populating your domino directory or any domino database with tivoli directory...
Uklug2011 Know your Notes
Quickr
Taking themes to the next level
Aussie outback
Implementing xpages extension library
Abb presentation uklug
Uklug2011.lotus.on.linux.report.technical.edition.v1.0
Domino testing presentation
Composite applications tutorial
Maximizing application performance
Error handling in XPages
wcm domino
leverage dxl

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Machine learning based COVID-19 study performance prediction
PPT
Teaching material agriculture food technology
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Approach and Philosophy of On baking technology
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Machine learning based COVID-19 study performance prediction
Teaching material agriculture food technology
Programs and apps: productivity, graphics, security and other tools
Empathic Computing: Creating Shared Understanding
Digital-Transformation-Roadmap-for-Companies.pptx
Diabetes mellitus diagnosis method based random forest with bat algorithm
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
20250228 LYD VKU AI Blended-Learning.pptx
cuic standard and advanced reporting.pdf
Network Security Unit 5.pdf for BCA BBA.
Encapsulation_ Review paper, used for researhc scholars
Per capita expenditure prediction using model stacking based on satellite ima...
Big Data Technologies - Introduction.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
Unlocking AI with Model Context Protocol (MCP)
Review of recent advances in non-invasive hemoglobin estimation
Approach and Philosophy of On baking technology

Binding to multiple datasources on a single xPage

  • 1. xPages Example: Binding to multiple datasources on a single xPage Author: John Mackey Groupware Solutions Inc. J [email_address] Blog: http://www.jmackey.net
  • 2. Overview Unlike Lotus Notes, xPages separates the presentation layer from the data This presents new opportunities and allows different approaches for Web application development xPages allows multiple datasources on the same page A simple action “Save Datasources” handles the updates for all bound datasources
  • 3. Bound to Order Form Bound to Customer Form Sample Screen shot of Orders page
  • 4. First Step: Create your Notes forms - schema To get started you need to define your forms and fields This is not required but the xPages IDE will not be able to provide you with drop down fields and you will not be able to drag and drop from the Data Palette, so it is beneficial to create a form. Here is the layout for the 2 forms:
  • 5. Create your views There are 2 standard views: Customers & Orders Note: column 5 on the customers view uses @NoteID. That will be used to bind the Customer document in the Panel control. You have to strip out the “NT” prefix. Customers Orders
  • 6. Create the Customer xPage Create a new xPage named “Customers” Set the Data Source Click Data from the Properties tab Click the Add button and select “Domino Document” Then select the form
  • 7. Create the Customer xPage (cont.) Next click on the Data palette link (this is cool!) Note: I noticed sometimes you need to click someplace on the form first before the Data Palette shows the fields Select all the fields and drag them to the page canvas. You can rearrange or change them later This will automatically create edit box controls in a table and setup the proper bindings
  • 8. Create the Orders xPage Follow the same basic steps from the Customer Page Create the new xPage named “Orders” Set the datasource Drag drop the fields Replace the “CustomerName” edit box control with a combobox control re-bind it to the CustomerName from the Data properties tab Click on the Values tab and add a Formula item: @DbColumn(@DbName(),"vCustomers",1)
  • 9. Create the Orders xPage (cont) Add a default label of “--select--” with a value of 0 use the “Up” arrows to position it as the first element
  • 10. Create the Orders xPage (cont) Drag a Panel control to the page – this is where we bind the customer data to the xPage Name it “CustomerData” Click on the Data tab for the panel and create a new Domino Document datasource named “customerDoc”, the form is “Customer”, the action is “Edit document”
  • 11. Create the Orders xPage (cont) We need to supply a document Id for the customer record Note: xPages use the document NoteId We will grab the NoteId from a lookup to the vCustomers view Click on the “Document ID” formula and enter the following Computed formula
  • 12. Create the Orders xPage (cont) Add the Customer fields to the Panel Click on the Data palette link Drag and drop the fields you want to the Panel Note: I replaced the ShippingInstructions with a Multi-line editbox in the below example
  • 13. Create the Orders xPage (cont) We need to set a property on the Panel control so that the Panel ignores any request parameters for the Orders page. For example: the page receives and uses parameters such as “editDocument” and “documentID”. For this use case we calculate the documentID for the Panel and so we want to ignore the page parameters. Click on the All Properties on the Properties tab for the “CustomerData” Panel Expand Data and set “ignoreRequestParams” to true
  • 14. Create the Orders xPage (cont) We need to make the page refresh when the Customer Name changes in the combobox Select the CustomerName combobox Select the Events tab and then the onChange event Include the following formula
  • 15. Create the View xPage You will need to create a view page for navigation Create a new xPage named “ViewCustomers” Drag a Tabbed control to the page Create 2 tabs (right click – insert tab) Name one “Customers”, the other “Orders” Drag a view control to the Customer tab Select your vCustomers view as the source Do the same for Orders and select the vOrders view as the source
  • 16. Create the View xPage (contd.) Make the first column a link Select the CustomerName column and set the link property Also, select the view and set the “open selected documents using” property on the data tab Do the same steps for the Orders view Link property Form to use
  • 17. Create the View xPage (contd.) Create 2 buttons so you can add Customers and Orders Drag a button Use the following simple action (substitute for Orders)
  • 18. Final Steps Add the save buttons to the Orders & Customers page Drag a button Select “Simple action” – Save Data Sources Select the “ViewCustomers” page to open next Set the default xPage to open for the database on the database properties launch tab
  • 19. Test the Application Create some Customers Create some Orders and change the Customer information from the Orders page Navigate to the Customer’s page and verify the Customer information was updated when the save occurred
  • 20. Questions?? Contact me if you have any questions [email_address] or comment on my blog: http://www.jmackey.net The Domino 8.5 discussion forum is: http://www-10.lotus.com/ldd/nd85forum.nsf