User Guide

The Objects API 123
Example
The following example opens the myObjectHelp.htm file in a browser; this file explains how to
use the extension:
function displayHelp(){
var myHelpFile = dw.getConfigurationPath() +
'/ExtensionsHelp/myObjectHelp.htm';
dw.browseDocument(myHelpFile);
}
isDomRequired()
Description
This function determines whether the object requires a valid DOM to operate. If this function
returns a
true value or if the function is not defined, Dreamweaver assumes that the command
requires a valid DOM and synchronizes the Code and Design views for the document before
executing. Synchronization causes all edits in the Code view to be updated in the Design view.
Arguments
None.
Returns
Dreamweaver expects a true value if a command requires a valid DOM to operate;
false otherwise.
insertObject()
Availability
Dreamweaver MX.
Description
This function is required if the objectTag() function is not defined. It is called when the user
clicks OK; it either inserts code into the user’s document and closes the dialog box or displays an
error message and leaves the dialog box open. This works as an alternate function to use in objects
instead of the
objectTag() function. It does not assume that the user is inserting text at the
current insertion point and allows data validation when the user clicks OK. You should use the
insertObject() function if one of the following conditions exists:
You need to insert code in more than one place.
You need to insert code somewhere other than the insertion point.
You need to validate input before inserting code.
If none of these conditions apply, use the objectTag() function.
Arguments
None.