Receivearguments(), Showif() – Adobe Extending Dreamweaver CS4 User Manual
Page 197
191
EXTENDING DREAMWEAVER CS4
Toolbars
receiveArguments()
Availability
Dreamweaver MX.
Description
Processes any arguments that pass from a toolbar item. The
receiveArguments()
function is equivalent to the
command
attribute in a toolbar item tag.
Arguments
For pop-up menus, combo boxes, text boxes, and color pickers, the first argument is the current value within the
control. The
getDynamicContent()
function can optionally attach individual IDs to items within a pop-up menu. If
the selected item in the pop-up menu has an ID attached, Dreamweaver passes that ID to the
receiveArguments()
function instead of the value. For combo boxes, if the current contents of the text box do not match an entry in the
pop-up menu, Dreamweaver passes the contents of the text box. To determine whether the text box matches,
Dreamweaver compares against the pop-up menu without case-sensitivity.
If you specified the
arguments
attribute, those arguments are passed next. If you did not specify the
arguments
attribute, Dreamweaver passes the ID of the item.
Returns
Dreamweaver expects nothing.
Example
function receiveArguments(newTitle)
{
var dom = dw.getDocumentDOM();
if (dom)
dom.setTitle(newTitle);
}
showIf()
Availability
Dreamweaver MX.
Description
Specifies that an item appears on the toolbar only if the function returns a
true
value. For example, you can use the
showIf()
function to show certain buttons only when the page has a certain server model. If the
showif()
function is
not defined, the item always appears. The
showIf()
function is the same as the
showIf
attribute in a toolbar item tag.
The
showIf()
function is called whenever the item’s enabler runs; that is, according to the value that the
getUpdateFrequency()
function returns.
Arguments
None.
Returns
Dreamweaver expects a Boolean value:
true
if the item appears;
false
otherwise.