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.
| To embed links in a CFTREE: |
tree3.cfm in Studio.
<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>
| Code | Description |
|---|---|
HREF="http://www.allaire.com"> | Make the node of the tree a link. |
HREF="http://forums.allaire.com" | Make the node of the tree a link. Note HREF can refer to the name of a column in a query if the tree item is populated from that query. |
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.