
152
Chapter 9 Building Dynamic Forms
Embedding URLs in a cftree
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
. The URL for the link can be a relative URL or an
absolute URL as in the following examples.
To embed links in a cftree:
1
Open a new file named
tree3.cfm
in ColdFusion Studio.
2
Modify the page so that it appears as follows:
<cfform action="submit.cfm">
<cftree name="oak"
highlighthref="Yes"
height="100"
width="200"
hspace="100"
vspace="6"
hscroll="No"
vscroll="No"
border="No">
<cftreeitem value="Important Links">
<cftreeitem value="Macromedia Home"
parent="Important Links"
img="document"
href="http://www.macromedia.com">
<cftreeitem value="ColdFusion Home"
parent="Important Links"
img="document"
href="http://www.coldfusion.com">
</cftree>
</cfform>
3
Save the page and view it in your browser.
Reviewing the code
The following table describes the highlight code and its function:
Code
Description
href="http://
www.macromedia.com">
Make the node of the tree a link.
href="http://
www.cofldusion.com">
Make the node of the tree a link.
Note that, although this example does not show it,
href
can refer to the name of a column in a query if the tree
item is populated from that query.
Содержание COLDFUSION 5-DEVELOPING
Страница 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Страница 58: ...38 Chapter 3 Querying a Database ...
Страница 134: ...114 Chapter 7 Updating Your Database ...
Страница 210: ...190 Chapter 10 Reusing Code ...
Страница 232: ...212 Chapter 11 Preventing and Handling Errors ...
Страница 238: ...218 Chapter 12 Using the Application Framework ...
Страница 262: ...242 Chapter 12 Using the Application Framework ...
Страница 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Страница 320: ...300 Chapter 15 Indexing and Searching Data ...
Страница 336: ...316 Chapter 16 Sending and Receiving E mail ...
Страница 374: ...354 Chapter 18 Interacting with Remote Servers ...