home
design & development
Lotus application development
print design
web site development
request a design quote
solutions & consulting
Notes and Domino application development
Lotus Domino administration
Securence Mail Filtering
UNITRENDS backup and recovery
Lotus Notes / Domino Apps
free Lotus Notes apps
hosting
web site hosting
Lotus application hosting
check your mail
request a hosting quote
publishing
media and publishing
sound
client services
help & support
Make Payment
Client Access - Workboard
billing & payment policies
copyright & liability policies
pricing & turnaround policies
privacy statement
contact
e-mail MW
get files
send files
Script Solution to put Document in Edit Mode
Mindwatering Incorporated
Author: Tripp W Black
Created: 12/11/2011 at 12:18 PM
Category:
Notes Developer Tips
XPages
Issue:
Change or set the Document state/mode via button or script in an XPage.
(Equivalent of @EditDocument on the web)
Solution:
context.setDocumentMode("edit");
to put the current document displayed into edit mode.
Other options are: readOnly, autoEdit, toggle.
To get the mode:
<datasource>.isEditable();
where <datasource> is the name of your document's datasource (e.g. doc1.isEditable();)
Example of visibility code for both a user role [staff] and a datasource xwp1:
var
uRoles:Array =
database
.queryAccessRoles(
session
.getEffectiveUserName());
var
editmode = xwp1.isEditable();
if
(@IsMember(
"[staff]"
, uRoles) && editmode==
false
) {
true
;
}
else
{
false
;
}
previous page
×