data - Data Source

Defines data sources for a page or control.

Category

data

Syntax

<xp:this.data>
	<xp:dominoDocument attributes>content</xp:dominoDocument> <!--for document source-->
	<xp:dominoView attributes>content</xp:dominoView> <!--for view source-->
	...
</xp:this.data
This property applies to pages and some container controls, and can contain any number of dominoDocument and dominoView elements.

Usage

In Design mode, ensure focus is on the page or container control. Click the Data tab under Properties, or click All Properties and look for data under data. You can add, edit, or remove data sources of type dominoDocument and dominoView.

Contained properties

Data sources have the following properties.
action="editDocument|openDocument"
(dominoDocument) Specifies the action for treating a data source upon page open and submission. Defaults to creating a new document upon page submission. The options editDocument and openDocument cause the page to be populated from the data source upon page open. The option editDocument causes the document to be replaced upon page submission.
allowDeletedDocs="true|false"
(dominoDocument) Allows or prohibits the opening of soft deleted documents.
categoryFilter="category"
(dominoView) Restricts the view contents to a category or categories (in an array).
computeDocument (dominoDocument) Activates an event handler when a document is computed or recomputed.
computeWithForm="onload|onsave|both"
(dominoDocument) Runs the form validation scripts when a document is loaded, saved, or both.
concurrencyMode="createResponse|fail|exception|force"
(dominoDocument) Specifies the handling of concurrent updates if multiple users update a document at the same time.
databaseName="name"
Specifies the database containing the data source where name is the file name of a database relative to the Notes® data directory. Defaults to the current database. The name can include a server if the database is not local. The name can be a replica ID.
dataCache="full|id|nodata"
(dominoView) Specifies how to cache data between requests for the same page.
documentId="#{javascript:database.script}"
(dominoDocument) The universal ID of the data source where script returns the universal ID. Substitute $ for # if compute on page load is desired. Alternatively you can specify a static value.
expandLevel="n"
(dominoView) Level of expansion for a hierarchical view.
formName="name"
(dominoDocument) Associates the data source with a Domino® form to store and retrieve documents.
ignoreRequestParams="true|false"
Ignores or recognizes parameters placed on the request map.
keys="key(s)"
(dominoView) Specifies keys for filtering the view. Each key (use an array for multiple keys) corresponds to a sorted column in the view in order.
keysExactMatch="true|false"
(dominoView) Requires that keys match exactly or allows partial matching.
loaded="true|false"
Creates or does not create the tag instance when the page is loaded.
parentId="#{javascript:database.script}"
The universal ID of the parent of the data source where script returns the universal ID. Substitute $ for # if compute on page load is desired. Alternatively you can specify a static value.
postNewDocument (dominoDocument) Activates an event handler after a document is created.
postOpenDocument (dominoDocument) Activates an event handler after a document is opened.
postOpenView (dominoView) Activates an event handler after a view is opened.
postSaveDocument (dominoDocument) Activates an event handler after a document is saved.
queryNewDocument (dominoDocument) Activates an event handler before a document is created.
queryOpenDocument (dominoDocument) Activates an event handler before a document is opened.
queryOpenView (dominoView) Activates an event handler before a view is opened.
querySaveDocument (dominoDocument) Activates an event handler before a view is saved.
requestParamPrefix="prefix"
Specifies a prefix for request parameters.
saveLinksAs="UseWeb|UseNotes|UseNotesAndWeb"
(dominoDocument) Specifies the handling of links.
scope="application|session|view|request"
Defines the scope of the data source
search="query"
(dominoView) Specifies a search query to filter the view.
searchMaxDocs="n"
(dominoView) Specifies the maximum number of documents to include in a view that is filtered by a search.
sortColumn="title"
(dominoView) Specifies the title of a column on which to sort the view. The column must be sortable in the view design.
sortOrder="n"
(dominoView) Specifies the collating order of the column.
startKeys="key(s)"
(dominoView) Specifies keys for the first row to be displayed in a sorted view. Each key (use an array for multiple keys) corresponds to a sorted column in the view in order.
var="name"
A global variable for making reference to the data source. Defaults to document1, document2, and so on for documents, and view1, view2, and so on for views.
viewName="name"
(dominoView) Associates the data source with a Domino® view.
webQuerySaveAgent="nameofagent"
(dominoDocument) Calls an agent after field values are applied but before the document is saved. The agent can access the in-memory document through DocumentContext in the LotusScript® NotesAgentContext class (see the HCL Domino® Designer Basic User Guide and Reference) or getDocumentContext in the Java AgentContext class (see the HCL Domino® Designer Basic User Guide and Reference). The agent can cancel the save operation by appending an item named SaveOptions with a value of 0 (zero).

Examples

This page defines one data source associated with form1.
<xp:this.data>
	<xp:dominoDocument var="document1" formName="form1"></xp:dominoDocument>
</xp:this.data>
This page defines three data sources two associated with forms and one with a view.
<xp:this.data>
	<xp:dominoDocument var="document1" formName="form1"></xp:dominoDocument>
	<xp:dominoView var="view1" viewName="view1"></xp:dominoView>
	<xp:dominoDocument var="document2" formName="form2"></xp:dominoDocument>
</xp:this.data>