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" 
  <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>">

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 ...

Get Programming ColdFusion MX, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.