User Guide
316 Chapter 18: Components
Populating the tree control
Use the
ComponentRec property to populate a Component panel tree control, so that it appears
within the Component panel in the proper location. Every node in a tree control must have the
following properties:
For example, the following WebServicesClass node has web methods as its children:
this.name = "TrafficLocatorWebService";
this.image = "Components/Common/WebServices/WebServices.gif";
this.hasChildren = true;
this.toolTipText = "TrafficLocatorWebService";
this.isCodeViewDraggable = true;
// the following allows of enabling/disabling of the button that appears
// above the Component Tree
this.allowDelete = true;
this.isDesignViewDraggable = false;
Component panel API functions
This section describes the API functions for populating the Component panel.
getComponentChildren()
Availability
Dreamweaver MX.
Description
This function returns a list of child ComponentRec objects for the active parent ComponentRec
object. To load the root-level tree items, this function needs to read its metadata from its
persistent store.
Arguments
{parentComponentRec}
• The parentComponentRec argument is the componentRec object of the parent. If it is
omitted, Dreamweaver expects a list of ComponentRec objects for the root node.
Property name Description Required/
Optional
name
Name of the tree node item Required
image
Icon of the tree node item. If it is not specified, a default
icon is used.
Optional
hasChildren
Responds to clicks on the Plus (+) and Minus (-)
buttons in the tree control by loading children.You can
work with a tree that is not prepopulated.
Required
toolTipText
Tooltip text of the tree node item Optional
isCodeViewDraggable
Determines whether the item can be dragged and
dropped into the Code view.
Optional
isDesignViewDraggable
Determines whether the item can be dragged and
dropped into the Design view.
Optional