O'Reilly logo

Programming ColdFusion MX, 2nd Edition by Rob Brooks-Bilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Trees

You can use the cftree tag to create a Java-based tree control within your cfform. Tree controls are useful in a number of data display and selection scenarios. Because they allow the user to expand and collapse branches, tree controls are particularly well suited for displaying large amounts of hierarchical data in a relatively small amount of screen space. You can build tree controls using the cftree tag, plus multiple cftreeitem tags for defining the individual branches. The following example uses the cftree tag to create the display area for a tree control:

<cfform action="#CGI.Script_Name#" name="MyForm" 
        enctype="application/x-www-form-urlencoded">
  <cftree name="MyTree" height="200" width="300" border="Yes" 
          hscroll="Yes" vscroll="Yes" lookandfeel="Windows"
          notsupported="<b>Your web browser must support Java to view 
                        ColdFusion Java Applets</b>">
  </cftree>
</cfform>

This example does nothing more than create an empty shell for the tree control. The name attribute specifies a name for the tree control. The height and width attributes specify the height and width in pixels for the tree control. border indicates whether to include a border around the tree control. The default is Yes. hscroll and vscroll each indicate whether or not to allow users to scroll horizontally and vertically, respectively, in the event the tree takes up more space than the boundaries of the control. Just as with the cfslider tag, lookandfeel controls the overall appearance of the tree control. Choices ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required