Presentation is loading. Please wait.

Presentation is loading. Please wait.

XPages Example: Generating Dynamic Editable Fields from a Document Collection Author: John Mackey Groupware Solutions Inc. John.Mackey@Groupwareinc.com.

Similar presentations


Presentation on theme: "XPages Example: Generating Dynamic Editable Fields from a Document Collection Author: John Mackey Groupware Solutions Inc. John.Mackey@Groupwareinc.com."— Presentation transcript:

1 xPages Example: Generating Dynamic Editable Fields from a Document Collection
Author: John Mackey Groupware Solutions Inc. Blog:

2 Overview This example extends a previous example: “Updating data from multiple forms on a single xPage”. You can download the previous example from here: This new example will walk you through how to use a Repeat control to generate fields dynamically for a document collection The Repeat control repeats a Panel control which binds to each Document in the collection The Panel control contains 3 editable fields bound to fields on each document A simple action “Save Datasources” handles the updates for all bound datasources

3 Sample Screen shot of Orders page
Bound to Order Form Bound to Multiple Response Documents * Fields are generated Dynamically on page load for each response document Bound to Customer Form

4 First Step: Create/Modify the Notes Forms
Create a new form named “OrderDetails”. Make it a Response document Here is the layout for the form: Modify the “Order” form from the previous example Add a new field named “OrderNumber” Delete the fields: ItemNumber,Price,Quantity Here is the layout for the form:

5 Modify the view Modify the Orders View
Change the selection formula to include the new “OrderDetails” form Check off the property “Show response documents in hierarchy” Add a column for “OrderNumber”

6 Modify the Orders xPage
Add new text for “Order Details” section Add a Button labeled “Add New Line”

7 Modify the Orders xPage
When the button is clicked we want to add a new response document and then reload the page. Note: the reloading of a page will be easier with Beta 2 by using context.reloadPage() The onclick() event for the button should be the following:

8 Modify the Orders xPage
Drag a Table control and then drag a Repeat control to the table Set the Options for the repeat control as below:

9 Modify the Orders xPage
For the Iteration formula for the repeat control, enter the following:

10 Modify the Orders xPage
Drag a Panel control to the Repeat Control On the Data tab for the Panel, create a new datasource named “OrderDetails” Set the form to “OrderDetails” Set the action to “Edit document”

11 Modify the Orders xPage
Set the “Document ID” to computed The document id will be the “Collection name” variable for the Repeat control. So as the Repeat control iterates through the response documents it will pass the NoteID in the variable “docid” to each Panel

12 Modify the Orders xPage
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

13 Modify the Orders xPage
Add a 3 column by 1 row table to the Panel Add a ComboBox control to the first column Bind it to the OrderDetails - ItemNumber field

14 Modify the Orders xPage
On the ItemNumber Values tab, Add some values: Add 2 EditBox controls and bind them to Price and Quantity

15 Recreate Orders View Control
Open up the “ViewCustomers” xPage Click on the Orders tab Delete the view and drag a new view control to the tab (I just find this easier then adding new columns) Select “vOrders” view for the source Select “Indent Responses” for the CustomerName column properties tab On the “Order Num” column properties tab, select “show values in this column as links”

16 Here’s a screen shot of the updated view

17 Test the Application Create some Orders and click “Add New Line” button numerous times You can also still update the Customer information from the Order This simple action handles all the updates:

18 Questions?? Contact me if you have any questions
or comment on my blog: The Domino 8.5 discussion forum is:


Download ppt "XPages Example: Generating Dynamic Editable Fields from a Document Collection Author: John Mackey Groupware Solutions Inc. John.Mackey@Groupwareinc.com."

Similar presentations


Ads by Google