Creating an XPage for a response documentAdded by IBM on September 28, 2011 | Version 1 (Original)
|A response document relies on the existence of a "parent" document. In a view, a response document typically appears indented under its parent. Response documents are useful, for example, to generate discussion threads.
A response document relies on the existence of a "parent" document. In a view, a response document typically appears indented under its parent. Response documents are useful, for example, to generate discussion threads.
Response documents are best set up on their own XPage.
- First you need a new form for creating response documents:
- In the Application Navigator, right-click Forms and select New Form.
- Name the form response and click OK.
- Right-click anywhere in the form edit area and select Form Properties. For the form type, select Response to Response.
The other options are Document
, which is a primary document, and Response
. A Response
form allows responses to primary documents, that is, only one level of responses, while a Response to Response
form allows responses to other response documents as well.
- On this form, put a table containing a subject field identical to the subject field on the main form.
You might copy from the main form.
- The form should look as follows. Save and close it.
- In the Application Navigator, right-click on XPages and select New XPage.
- Name the XPage response but DO NOT immediately click OK.
- Select the Add data source to the page option on the New XPage dialog.
- From the Data Source drop-down list, select Domino Document for the data source.
- From the Form drop-down list, select response.
- Click OK.
- You need only one data item:
- On the right, click the Data tab.
If the tab is not there, click Window -> Show Eclipse Views -> Data. Your document1 data source should be visible.
- Ensure that Select Controls dialog box (the icon above the words Data source) is enabled.
Hovering over the dialog shows you the current state. Click on the box to enable the setting if it is currently disabled.
- Drag the subject item to the edit area.
- In the dialog that opens, select Add Submit button to generated code and click OK.
- From the Controls tab, add a button and make it a Cancel button, as you did for the main XPage.
- For navigation after a submit or cancel, put focus on the XPage itself and select Previous Page.
This takes the user to a mainview
, or response
page, whatever the user was last on. Alternatively you could make this specification mainview
to always go back to the view.
- Save the response XPage.
You still need to set up the mechanism for getting to this page for the purpose of creating a new response document, but first let's see how to get to existing documents.
Parent topic: Your first XPages application