JavaScript object model

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 preceding 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 applets array includes Domino action bar, view, and rich text applets as well as applets you import. Applets are represented by the <APPLET> tag in HTML. You can refer to an applet by name, for example, document.AppletName, if you specify a name under the HTML tab of Applets properties.

    For more information, see the help topic Adding an applet, or Designing Pages in Application Development with Domino Designer.

  • The links array includes Domino actions, link hotspots, and action hotspots, which are represented in HTML by the <A> tag. You can refer to action hotspots by name, for example, document.HotspotName, if you specify a name under the HTML tab of the HotSpot Properties box.

    Domino link hotspots do not contain event handlers. However, you can specify a handler in Other under the <HTML> tag of the HotSpot Properties box.

  • The images array includes Domino attachments, image resources, and pictures, which are represented in HTML by the <IMG> tag. You can refer to pictures by name, for example, document.PictureName, if you specify a name under the HTML tab of the Pictures Properties box.

    You can refer to a Domino image resource with a URL that specifies the database name or replica ID followed by the name of the image resource, for example, /Web+Test.nsf/newdam.gif.

  • The forms array typically has one element, document.forms[0] named _DominoForm, which is represented in HTML by the <FORM> tag. It has an array of named elements that contains any objects of type Button, Text, Textarea, Password, Select, Radio, Checkbox, Hidden, and FileUpload.
  • The Button object represents Domino buttons, which are represented in HTML by the <INPUT TYPE=button> tag. You can refer to buttons by name, for example, document.forms[0].ButtonName, if you specify a name under the HTML tab of the Button Properties box.
  • The Text object represents Domino fields of type Text, Date/Time, Number, Names, Authors, and Readers, which are represented in HTML by the <INPUT> tag. You can refer to Text objects by their Domino field names, for example, document.forms[0].FieldName.
  • The TextArea object represents Domino fields of type RichText. It is represented in HTML by the <TEXTAREA> tag. You can refer to TextArea objects by their Domino field names, for example, document.forms[0].FieldName.
  • The Password object represents Domino fields of type Password, which are represented in HTML by the <INPUT TYPE=password> tag. You can refer to Password objects by their Domino field names, for example, document.forms[0].FieldName.
  • The Select object represents Domino fields of type Dialog list, Listbox, and Combobox, which are represented in HTML by the <SELECT> tag. You can refer to Select objects by their Domino field names, for example, document.forms[0].FieldName.
  • The Radio object represents Domino fields of type Radio button, which are represented in HTML by the <INPUT TYPE=radio> tag. You can refer to Radio objects by their Domino field names, for example, document.forms[0].FieldName.
  • The Checkbox object represents Domino fields of type Checkbox, which are represented in HTML by the <INPUT TYPE=checkbox> tag. You can refer to Checkbox objects by their Domino field names, for example, document.forms[0].FieldName.
  • The Hidden object represents Domino fields when the Hide paragraph when document is attribute is selected. A hidden field is represented in HTML by the <INPUT TYPE=hidden> tag, no matter what kind of field it is, if Generate HTML for all fields is selected in the Form Properties box. Otherwise, hidden fields are not accessible to JavaScript in a browser; they are never accessible to JavaScript in the Notes client. You can refer to Hidden objects by their Domino field names, for example, document.forms[0].FieldName.
  • The FileUpload object has no direct representation as a Domino field type. You can generate this object in a browser by creating a field (for example, of type Text) and specifying INPUT TYPE=file for Other under the HTML tab. A FileUpload object cannot be accessed in the Notes client.

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.