PROGRAMMING DOMINO FOR WEB APPLICATIONS


JavaScript object model
Example

Lotus Domino supports the standard JavaScript object model. For information on the JavaScript object model, see http://developer.netscape.com/tech/javascript, http://developer.netscape.com/docs/manuals/js/client/jsguide, and http://msdn.microsoft.com/scripting.

Browser implementation of the object model depends upon the browser. The Notes client implements the object model with some exceptions. For information on the Notes implementation, see the Notes Release 5 Client Document Object Model in http://www.lotus.com/ldd/doc.

The JavaScript objects map to the Domino design elements as discussed in the following sections.

Navigator

The navigator object applies to the currently opened form, page, view, or frameset. The appName, appCodeName, appVersion, platform, and userAgent properties apply to the invoking browser or client and return the same information no matter what the base Domino Designer object is.

Window

The window object applies to the currently opened form, page, view, or, for a frameset, the frame that is in focus. Suppose you design two pages named "Page One" and "Page Two," and a frameset with two frames named "High" and "Low," where "High" opens "Page One" and "Low" opens "Page Two." If you open "Page One" on its own, window.status means the status property of "Page One." If you open the frameset, window.status means "Page One" when the focus is on "High" and "Page Two" when the focus is on "Low."

Frame

Domino frames can be accessed by name and through the frames array. The name is as specified in the Frame Properties box. Use window.top to access the window representing the frameset. For example, if a frameset has two frames named "High" and "Low," you can refer to the first frame as window.top.High or window.top.frames[0], and the second as window.top.Low or window.top.frames[1].

The name property initially contains the Domino frame name and is empty if the window does not represent a Domino frame.

Nested frames represent nested Domino framesets. For example, if the "Low" frame contains another frameset with two frames named "Left" and "Right," you can refer to "Left" as window.top.Low.Left, window.top.frames[1].frames[0], or some combination of names and frame elements.

Use the "parent" property to access the parent window of a frame. If the focus is in the "Right" frame in the above example, window.parent refers to window.top.Low and window.parent.Left refers to the adjacent window.top.Low.Left.

History and location

The history and location objects apply to whatever the parent window applies.

Document

The document object represents the contents of the currently open Domino form, page, or view. The document object contains the following:


The names of Domino fields are case sensitive. In Edit mode, Domino fields are accessible to JavaScript in a browser and the Notes client with restrictions as noted for hidden fields. In Read mode, Domino fields are not accessible to JavaScript in a browser unless "Generate HTML for all fields" is selected in the Form Properties box. In Read mode, Domino fields are never accessible to JavaScript in the Notes client.

Example
See Also