![]() ![]() ![]() |
The HREF attribute in the CFTREEITEM tag allows you to designate tree items as links. To use this feature in a CFTREE, you simply define the destination of the link in the HREF attribute of CFTREEITEM.
<CFFORM ACTION="submit.cfm"> <CFTREE NAME="oak" HIGHLIGHTHREF="yes" HEIGHT="100" WIDTH="200" HSPACE="100" VSPACE="6" HSCROLL="no" VSCROLL="no" BORDER="no" DELIMITER="?"> <CFTREEITEM VALUE="Important Links"> <CFTREEITEM VALUE="Allaire Home" PARENT="Important Links" IMG="document" HREF="http://www.allaire.com"> <CFTREEITEM VALUE="Allaire Forums" PARENT="Important Links" IMG="document" HREF="http://forums.allaire.com"> </CFTREE> </CFFORM>
The resulting tree control looks like this:
When a user selects a tree item and submits the form, the CFTREEITEMKEY variable is appended to the URL passed to the application page specified in the CFFORM ACTION attribute, in the form:
http://myserver.com?CFTREEITEMKEY=selected_value
You can disable this key by setting the APPENDKEY attribute in the CFTREE tag to No.
Use the TARGET attribute in the CFTREEITEM tag to specify a target for the link you've specified in the HREF attribute. When populating a CFTREE with data from a CFQUERY, you can separate TARGET attribute values in a comma-separated list to correspond with each level of linked tree items in your CFTREE, as shown here:
TARGET="FRAME_BODY,_blank,_top"
![]() ![]() ![]() |
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.