Change Document Mode (Simple actions)
Changes the access mode for the current page.
Defined in
Simple actionsType of simple action
Document (Server)Syntax
Note: This is the XSP source code. The
UI presents the simple action as a dialog with a box for each argument.
changeDocumentMode mode="string"
Arguments | Description | UI presentation |
---|---|---|
mode |
One of the following:
|
A combo box with the options Toggle, Read Mode, Auto Edit, and Edit Mode, plus the diamond icon. You can click the diamond to dynamically compute the value. |
Usage
The user must have permission for the specified mode. Otherwise a lesser mode prevails.Examples
Note: These examples present XSP source
code which can be inserted under the Source tab taking care to keep
the XML well formed. To use the UI, select or enter the arguments
in the simple action dialog.
(1) This button changes the document
to edit mode. <xp:button value="Edit" id="button1" style="width:110.0px">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:changeDocumentMode mode="edit"></xp:changeDocumentMode>
</xp:this.action></xp:eventHandler></xp:button>
(2)
This link changes the document to edit mode for users with permission
to edit. The document opens in read mode for users without permission
to edit.
<xp:link id="link1" text="Edit this document">
<xp:eventHandler event="onclick" submit="true" refreshMode="complete">
<xp:this.action>
<xp:changeDocumentMode mode="autoEdit"></xp:changeDocumentMode>
</xp:this.action></xp:eventHandler></xp:link>