Cftree download file
In Flash format, use the same syntax and contents as used in Flex for the corresponding Flash element. Flash format only: Boolean value that specifies whether to show the control. Space that would be occupied by an invisible control is blank. Tree control width, in pixels. This tag must be in a cfform tag block. The applet format tree requires the client to download a Java applet.
Also, if the client does not have an up-to-date Java plug-in installed, the system might also have to download an updated Java plug-in to display an applet format tree. If you specify Flash format for this tag in an HTML format form, and you do not specify height and width attributes, Flash takes up more than the remaining visible area on the screen.
If any other output follows the tree, including any form controls, users must scroll to see it. Therefore, if you follow a Flash tree in an HTML form with additional output, specify height and width values. If the following conditions are true, a user's selection from query data that populates this tag's options continues to display after the user submits the form:.
When you select a tree item and submit the form that contains the tree, ColdFusion creates a structure with two variables in the action page Form scope. The structure name is the tree name. The following table lists the fields:. In applet format, the path includes the root node only if the completePath attribute is true.
In Flash format, the path always includes the root node. If you specify object in the format attribute, ColdFusion returns the tree as a ColdFusion structure, and does not send the tree to the browser. You can, for example, loop over the structure to populate a menu, generate "breadcrumb" links for page navigation, or create a DHTML tree. The structure variable name is specified by the cftree name attribute.
The top level of the structure has two types of entries:. The tree image icon Image to display as an icon for the tree item; value of cftreeitem img attribute. You can use the img attribute to display custom icons only in the Applet version; not in the Flash version. The following example creates a tree that shows available courses from the CourseList table of the cfdocexamples database, and puts each department's courses in a folder.
This example is displayed in Flash and uses the Departments list to get department names. The following example creates a tree that shows the basic information about all employees in an organization, organized by department. The departments are expanded to show all employees. If you click the employee name, ColdFusion links back to the same page and displays the Path and node values for the selection.
Legal Notices Online Privacy Policy. See also. ColdFusion MX7. Added enabled, onChange, style, tooltip, and visible attributes Flash format only. ColdFusion MX: Changed behavior: ColdFusion renders a tree control regardless of whether there are any treeitems within it. A Boolean value that specifies whether to get new data each time the user expands tree nodes, as follows: yes: fetches a node's child items only once, when the node is first expanded no: fetches child items each time the node is expanded.
For the preserveData attribute of cfform to work with the tree, set this attribute to yes. For tree items populated by a query, if you use the cftreeitem queryasroot attribute to specify a root name, that value is returned.
If you do not specify a root name, ColdFusion returns the query name. If the platform does not support a style option, the tag uses the default style for the platform. You can specify the character used to delimit each element of the path form variable in the cftree delimiter attribute. The default is a backslash character. Although the cftree tag does not include a validate attribute, you can use the required attribute to force a user to select an item from the tree control.
In addition, you can use the onValidate attribute to specify your own JavaScript code to perform validation. Tree controls built with the cftree tag can be complex. Knowing how to specify the relationship between multiple cftreeitem entries helps you handle the most complex cftree constructs.
When populating a cftree control, you create the multilevel structure of the tree by specifying a parent for each item in the tree. The parent attribute of the cftreeitem tag allows your cftree tag to show relationships between elements in the tree. In this example, every cftreeitem tag, except the top level Divisions, specifies a parent. For example, the cftreeitem tag specifies Divisions as its parent.
The following code populates the tree directly, not from a query:. Note: The information here applies to applet format trees. In Flash, you cannot control the tree icons. Flash uses open and closed folders and documents as the icons. In object format, the image information is preserved in fields in the object structure. The default image displayed in a tree is a folder. However, you can use the img attribute of the cftreeitem tag to specify a different image.
When you use the img attribute, ColdFusion displays the specified image beside the tree items when they are not open. When you use the imgopen attribute, ColdFusion displays the specified image beside the tree items when they are open expanded. You cannot use a custom image in Flash format. As a general rule, make the height of your custom images less than 20 pixels. When populating a cftree control with data from a cfquery tag, you can use the img attribute of cftreeitem tag to specify images or filenames for each level of the tree as a comma-separated list.
The following are the ColdFusion built-in image names:. Note: In applet format, you can also control the tree appearance by using the cftree tag lookAndFeel attribute to specify a Windows, Motif, or Metal look. The href attribute in the cftreeitem tag lets you designate tree items as links. To use this feature in a cftree control, you define the destination of the link in the href attribute of the cftreeitem tag. Makes the node of the tree a link.
Although this example does not show it, the href attribute can refer to the name of a column in a query if that query populates the tree item. When a user clicks a tree item to link to a URL, the cftreeItemKey variable, which identifies the selected value, is appended to the URL in the following form:.
Automatically passing the name of the selected tree item as part of the URL makes it easy to implement a basic "drill down" application that displays additional information based on the selection. To disable this behavior, set the appendkey attribute in the cftree tag to no. Legal Notices Online Privacy Policy. Building tree controls with the cftree tag Search. You can create trees in three formats: Applet Creates a Java applet that the client must download.
Downloading an applet takes time; therefore, using the cftree tag can be slightly slower than using an HTML form element to retrieve the same information. In addition, browsers must be Java-enabled for the cftree tag to work properly. Object Creates a hierarchical ColdFusion structure that represents the tree data and many of the cftree and cftreeitem attributes.
0コメント