NotesXspDocument (JavaScript)

Represents a document associated with the XPage context in which the server script is running.

Usage

Where a data source for an XPage is a Domino® document, a global variable of type NotesXspDocument representing the data source becomes available. By default, global variables representing document data sources on a page are named document1, document2, and so on.
A global variable named currentDocument represents the closest data source. Suppose a page contains a Panel control with a data source document2 while the page itself has a data source document1. Outside the Panel control, currentDocument means document1. Inside the Panel control, currentDocument means document2.
To work directly with documents from the Domino® data store, use NotesDocument.

Examples

This Open simple action uses scripts to set a condition and to specify a target.
<xp:button id="button1" value="Open parent"><xp:eventHandler event="onclick" submit="true" refreshMode="complete"><xp:this.action>
	<xp:actionGroup
			condition="#{javascript:document1.isResponse()}">
			<xp:openPage name="/main.xsp"
				target="#{javascript:return document1.getParentId()}">
			</xp:openPage>
	</xp:actionGroup>
</xp:this.action></xp:eventHandler></xp:button>