PROGRAMMING DOMINO FOR WEB APPLICATIONS


@Commands on the Web
The @commands listed below are supported on the Web; the @commands not mentioned here do not work on the Web. These @commands may have restrictions or behave differently on the Web than in the Notes client.
CalendarFormat

The CalendarFormat @command changes the number of days that a calendar view displays. The Web options are:

@Command([CalendarFormat] ; "1")

@Command([CalendarFormat] ; "2")

@Command([CalendarFormat] ; "7")

@Command([CalendarFormat] ; "14")

@Command([CalendarFormat] ; "30")

@Command([CalendarFormat] ; "365")

This @command is equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenView&Grid=n&Date=yyyy-mm-dd

CalendarGoto

The CalendarGoto @command goes to a specified date in a calendar view. The following example goes to today's date:

@Command([CalendarGoTo]; @Today)

This @command is equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenView&Grid=n&Date=yyyy-mm-dd

Compose

The Compose @command creates a new document.

To create a main document in the current database, specify only the form parameter and implement Compose in a view, page, or navigator. The following example, implemented as a view action, creates a main document based on the "Main Topic" form.

@Command([Compose]; "Main Topic")

To create a response document, specify the @command as above but implement it in an open document. For example, if the following code is implemented as an action on the "Main Topic" form, opening a document based on that form and pressing the button creates a response document:

@Command([Compose]; "Response")

To create a main document in another database, specify the database and form parameters. You must specify server as an empty string because the browser cannot access another server. The following example creates a new document in "document examples.nsf" based on the "Main Topic" form in that database.

@Command([Compose]; "" : "document examples.nsf"; "Main Topic")

These @commands are equivalent to URL commands formatted as follows:

http://host/database/view?OpenForm

http://host/database/form?OpenForm&ParentUNID=mainunid

EditClear and Clear

The EditClear and Clear @commands delete the current, open document:

@Command([EditClear])

or

@Command([Clear])

For Web applications, you can implement these @commands only in a form. After the deletion, a document with the text "Deleted" replaces the current document.

In the Notes client, these @commands mark documents for deletion or delete text, depending on the design element they are used in.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/view/universalID?DeleteDocument

EditDocument

The EditDocument @command toggles a document between Read and Edit modes:

@Command([EditDocument])

For Web applications, you cannot use the mode and previewpane parameters.

This @command is equivalent to a URL command formatted as follows:

http://host/database/view/universalID?EditDocument

EmptyTrash

The EmptyTrash @command deletes the documents marked for deletion and refreshes the current view.

@Command([EmptyTrash])

This @command works for a view on the Web if "Use applet in the browser" or "Allow selection of documents" is in effect.

FileCloseWindow and CloseWindow

In a browser, the FileCloseWindow and CloseWindow @commands simulate closing a window by loading another page, usually the previous page displayed.

See FileSave for using FileCloseWindow or CloseWindow with FileSave to submit a document.

FileCloseWindow and CloseWindow do not work on the Web unless "Use JavaScript when generating pages" is set in the database properties. This is the default.

FileOpenDatabase

On the Web, use the FileOpenDatabase @command only as shown in conjunction with OpenDocument.

FileSave

The FileSave @command saves the current document, which must be open for editing.

To submit a document that is open for editing, issue FileSave followed by OpenView, FileCloseWindow, or CloseWindow. This can be implemented as a form action or button.

Using FileSave followed by OpenView saves the document then opens a specified view in the browser, for example:

@Command([FileSave]);
@Command([OpenView]; "All Documents")

Using FileSave followed by FileCloseWindow or CloseWindow saves the document then uses the $$Return field or lack thereof to determine what to open next in the browser.

@Command([FileSave]);
@Command([FileCloseWindow])

or

@Command([FileSave]);
@Command([CloseWindow])

If the document contains no $$Return field, the browser displays a page with the message, "Form processed."

If the document contains a $$Return field, the browser displays its HTML or follows a link. Typically $$Return is a "computed for display" text field. The following example presents some text followed by a view link:

"<h3>Document submitted<h3><hr><font size=2><a href=/" +
@WebDbName +
"/All%20Documents?OpenView>All Documents view</a>"

To have the browser follow a link, specify the formula for the $$Return field as a Domino URL command in brackets. The following example opens a view:

"[/" + @WebDbName + "/All%20Documents?OpenView]"

See "Customizing 'Form processed' confirmation for the Web" in Application Development with Domino Designer for more information.

FileSave does not work on the Web unless "Use JavaScript when generating pages" is set in the database properties. This is the default.

Folder and FolderDocuments

The Folder and FolderDocuments @commands copy or move selected documents from a view or folder to a folder.

1. This code copies the selected documents to the Favorite Stuff folder:


2. This code moves the selected documents to the Archive folder:
These @commands work on the Web only if "Use applet in the browser" is in effect for the implementing view or folder.

MoveToTrash

The MoveToTrash @command marks selected documents in a view or folder for deletion.

@Command([MoveToTrash])

This @command works for a view on the Web if "Use applet in the browser" or "Allow selection of documents" is in effect.

NavigateNext and NavNext

The NavigateNext and NavNext @commands open the next document in the current view or folder.

@Command([NavigateNext])

or

@Command([NavNext])

For Web applications, you can only use these @commands on forms; you cannot use them in views or folders.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenDocument

NavigateNextMain and NavNextMain

The NavigateNextMain and NavNextMain @commands open the next main document in the current view or folder.

@Command([NavigateNextMain])

or

@Command([NavNextMain])

For Web applications, you can only use these @commands on forms; you cannot use them in views or folders.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenDocument

NavigatePrev and NavPrev

The NavigatePrev and NavPrev @commands open the previous document in the current view or folder.

@Command([NavigatePrev])

or

@Command([NavPrev])

For Web applications, you can only use these @commands on forms; you cannot use them in views or folders.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenDocument

NavigatePrevMain and NavPrevMain

The NavigatePrevMain and NavPrevMain @commands open the previous main document in the current view or folder.

@Command([NavigatePrevMain])

or

@Command([NavPrevMain])

For Web applications, you can only use these @commands on forms; you cannot use them in views or folders.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/universalID?OpenDocument

OpenDocument

The OpenDocument command, used in conjunction with OpenView, opens an existing document in the current database. The view must be sorted and the OpenView command must specify key exactly except for case. For example, the following code opens the first document in "Main View" whose first sorted column contains the value "one":

@Command([OpenView]; "Main View"; "one");
@Command([OpenDocument])

This differs from the Notes client in several respects:


For Web applications, you can open the first document in the view with the argument "$first":

@Command([OpenView]; "Main View"; "$first");
@Command([OpenDocument])

To open the document in Edit mode, specify as "1" the writeOrReadOnly parameter to OpenDocument. For example:

@Command([OpenView]; "Main View"; "one");
@Command([OpenDocument]; "1")

For Web applications, you cannot use the UNID and width:height parameters to OpenDocument.

The OpenDocument command, used in conjunction with FileOpenDatabase, opens an existing document in another database. This example opens the first document in the "All Documents" view in "document examples.nsf":

@Command([FileOpenDatabase];
"" : "document examples.nsf"; "All Documents"; "$first");
@Command([OpenDocument])

These @commands are equivalent to URL commands formatted as follows:

http://host/database/view/key?OpenDocument

http://host/database/view/key?EditDocument

OpenFrameset

The OpenFrameset @command opens a frameset.

@Command([OpenFrameset]; "WebToDoFS")

This @command is equivalent to a URL command formatted as follows:

http://host/database/frameset?OpenFrameSet&Frame=NotesView&Src=source

OpenHelpDocument

The OpenHelpDocument @command opens a Help database, or a specified database, to a specified document. The following example opens Designer Help to the "OpenDocument" topic in the "Search" view:

@Command([OpenHelpDocument]; [DesignerHelp]; "Search"; "OpenDocument")

This @command is equivalent to a URL command formatted as follows:

http://host/database/frameset?OpenFrameSet&Frame=Topic&Src=source

OpenNavigator

The OpenNavigator @command opens a navigator.

@Command([OpenNavigator]; "Main Navigator")

Do not use the solo parameter in a Web application.

This @command is equivalent to a URL command formatted as follows:

http://host/database/navigator?OpenNavigator

OpenPage

The OpenPage @command opens a page.

@Command([OpenPage]; "Page One")

This @command is equivalent to a URL command formatted as follows:

http://host/database/page?OpenPage

OpenView

The OpenView @command opens a view in the current database. For example, the following code opens "Main View":

@Command([OpenView]; "Main View")

If key is specified, the view must be sorted and the OpenView command must specify key exactly except for case. On the Web, the view opens with the row containing key at the top. The following code opens "Main View" at the first row that contains the value "one":

@Command([OpenView]; "Main View"; "one");
@Command([OpenDocument])

In the Notes client, you can specify a partial key, for example, "o" or "on" instead of "one." In a Web application, the key must be exact.

In a Web application, the argument "$first" for key means the first row.

These @commands are equivalent to URL commands formatted as follows:

http://host/database/view?OpenView

http://host/database/view/OpenView?StartKey=one

See FileSave for using OpenView with FileSave to submit a document.

RefreshFrame

On the Web, the RefreshFrame @command refreshes the current frame ignoring any parameter.

@Command([RefreshFrame])

RemoveFromFolder

The RemoveFromFolder @command removes selected documents from a folder.

@Command([RemoveFromFolder])

This @command works on the Web only if "Use applet in the browser" is in effect for the implementing view or folder.

ToolsRunMacro and RunAgent

The ToolsRunMacro and RunAgent @commands run an agent in the current database. For example, the following formula runs the agent "Status = open":

@Command([ToolsRunMacro]; "Status = open")

or

@Command([RunAgent]; "Status = open")

Agents run on the Domino server containing the database not on the browser computer. See "Web Agents."

ViewChange and SwitchView

The ViewChange and SwitchView @commands open a view in the current database. For example, the following formula opens "Main View":

@Command([ViewChange]; "Main View")

or

@Command([SwitchView]; "Main View")

In a Web application, you cannot omit the view parameter.

These @commands are equivalent to a URL command formatted as follows:

http://host/database/view/OpenView

ViewCollapse

The ViewCollapse @command collapses everything in the current category or under the current main document in a view.

@Command([ViewCollapseAll])

This @command works for a view on the Web only if "Using Java Applet" is in effect.

ViewCollapseAll

The ViewCollapseAll @command collapses a view so that only the topmost level of category names appears.

@Command([ViewCollapseAll])

This @command is equivalent to a URL command formatted as follows:

http://host/database/viewy/OpenView&Start=1&Count=30&CollapseView

ViewExpand

The ViewExpand @command expands everything in the current category or under the current main document in a view.

@Command([ViewCollapseAll])

This @command works for a view on the Web only if "Using Java Applet" is in effect.

ViewExpandAll

The ViewExpandAll @command expands a view so that all levels appear.

@Command([ViewExpandAll])

This @command is equivalent to a URL command formatted as follows:

http://host/database/By+Category/OpenView&Start=1&Count=30&ExpandView

ViewRefreshFields

The ViewRefreshFields @command recalculates all computed field values in the current, open document:

@Command([ViewRefreshFields])

This @command works on the Web only if "Use applet in the browser" is in effect for the implementing view or folder.

ViewShowSearchBar

In a Web application, the ViewShowSearchBar @command opens the search view.

@Command([ViewSearchBar])

In the Notes client, this @command toggles the search bar in a view.

This @command is equivalent to a URL command formatted as follows:

http://host/database/universalID/$searchForm?SearchView