Checked="script, Value="script, Update="update_frequency_list – Adobe Extending Dreamweaver CS4 User Manual
Page 189
183
EXTENDING DREAMWEAVER CS4
Toolbars
checked="script"
This attribute is required for check buttons and radio buttons. Dreamweaver ignores the
checked
attribute for other
types of items. As with menus, the script returns a value that specifies whether the item is checked or unchecked. The
checked
attribute is equivalent to
isCommandChecked()
in a toolbar command file. If you do not specify this
attribute, it defaults to unchecked.
Example
checked="dw.getDocumentDOM() != null && dw.getDocumentDOM().getView() == 'code'"
value="script"
This attribute is required for pop-up menus, combo boxes, text boxes, and color pickers. Dreamweaver ignores the
value
attribute for other types of items.
To determine what value to display for pop-up menus and combo boxes, Dreamweaver first calls
isCommandchecked()
for each item in the menu. If the
isCommandchecked()
function returns a
true
value for any
items, Dreamweaver displays the value for the first one. If no items return a
true
value or the
isCommandChecked()
function is not defined, Dreamweaver calls the
getCurrentValue()
function or executes the script that the
value
attribute specifies. If the control is a combo box, Dreamweaver displays the returned value. If the control is a pop-up
menu, Dreamweaver temporarily adds the returned value to the list and displays it.
In all other cases, the script returns the current value to display. For pop-up menus or combo boxes, this value should
be one of the items in the menu list. For combo boxes and text boxes, the value can be any string that the script returns.
For color pickers, the value should be a valid color but Dreamweaver does not enforce this.
The value attribute is equivalent to the
getCurrentValue()
function in a toolbar command file.
update="update_frequency_list"
Optional. This attribute specifies how often the
enabled
,
checked
,
showif
, and
value
handlers should run to update
the visible state of the item. The
update
attribute is equivalent to the
getUpdateFrequency()
function in a toolbar
command file.
You must specify the update frequency for toolbar items because these items are always visible, unlike menu items. For
this reason, you should always select the lowest frequency possible and make sure your handlers for the
enabled
,
checked
, and
value
handlers are as simple as possible.
The following list shows the possible handlers for update_frequency_list, from least to most frequent. If you do not
specify the
update
attribute, the update frequency defaults to
onEdit
frequency. You can specify multiple update
frequencies, separated by commas. The handlers run on any of the following specified events:
•
onServerModelChange
executes when the server model of the current page changes.
•
onCodeViewSyncChange
executes when the Code view becomes in or out of sync with the Design view.
•
onViewChange
executes whenever the user switches focus between Code view and Design view or when the user
changes between Code view, Design view, or Code and Design view.
•
onEdit
executes whenever the document is edited in Design view. Changes that you make in Code view do not
trigger this event.
•
onSelChange
executes whenever the selection changes in Design view. Changes that you make in Code view do not
trigger this event.