User Guide

Behavior functions 303
dreamweaver.templatePalette.renameSelectedTemplate() (deprecated)
Availability
Dreamweaver 3; deprecated in Dreamweaver 4 in favor of using
dreamweaver.assetPalette.setSelectedCategory() with
"templates" as the argument value, and
then calling dreamweaver.assetPalette.renameNickname()
.
Description
This function turns the name of the selected template into a text field, so the user can rename
the selection.
Arguments
None.
Returns
Nothing.
Behavior functions
Behavior functions let you add behaviors to and remove them from an object, find out which
behaviors are attached to an object, get information about the object to which a behavior is
attached, and so on. Methods of the
dreamweaver.behaviorInspector object either control or
act on only the selection in the Behaviors panel, not the selection in the current document.
dom.addBehavior()
Availability
Dreamweaver 3.
Description
Adds a new event/action pair to the selected element. This function is valid only for the
active document.
Arguments
event, action, {eventBasedIndex}
The event argument is the JavaScript event handler that should attach the behavior to the
element (for example, onClick, onMouseOver, or onLoad).
The action argument is the function call that applyBehavior() returns if the action is added
using the Behaviors panel (for example,
"MM_popupMsg('Hello World')").
The eventBasedIndex argument, which is optional, is the position at which this action
should be added. The
eventBasedIndex argument is a zero-based index; if two actions already
are associated with the specified event, and you specify
eventBasedIndex as 1, this action
executes between the other two. If you omit this argument, the action is added after all existing
actions for the specified event.
Returns
Nothing.
000_DW_API_Print.book Page 303 Wednesday, August 20, 2003 9:14 AM