Viewing Individual Entry / Main
  ::   August 20, 2003

Another CFTREE Bug in MX 6.1 - That Makes Two in One Day
I've been putting the example files together for my new book, Programming ColdFusion MX, and have been (re)testing each one along the way. Unfortunately, it looks like something changed in MX 6.1 (from 6.0 updater 3) that breaks a lot of the functionality of the CFTREE tag and its related sub tags. I already reported on another CFTREE bug earlier today. Looks like I've found another. This one, like the last, is fairly problematic - especially if you make use of the CFTREE tag in a lot of your applications. I personally rarely use it anymore as I really dislike Java applets and all of the games you have to play with different JVMs and different browsers. However, I do still have a few "legacy" web apps that use the CFTREE tag, and now they are broken.

As with the last bug, this one is with the cftreeitem tag. I've worked up an example that works fine in MX 6.0 Updater 3, but breaks in MX 6.1. It consists of two files. Save the first one as anything you want. The second one is a custom tag that must be saved in the same directory as "recurse.cfm". Basically, the example uses recursion to loop through a DB table and dynamically build a CFTREE based on the parent/child relationships in the table. Works fine in 6.0, results in an empty tree in 6.1:

Here's the caller template (the one you run):

















































You chose:


Node: #form.Links.Node#

Path: #form.Links.Path#





vscroll="Yes" border="Yes" required="Yes" appendkey="No"
message="You must choose a category or item from the tree.">









Here's the code for the custom tag (recurse.cfm):






SELECT ItemID, ParentItemID, ItemName, LinkURL
FROM request.links WHERE ParentItemID = #attributes.ParentItemID#
ORDER BY ItemName












href="#LinkURL#" img="#Image#" expand="No">


SELECT ItemID, ParentItemID, ItemName, LinkURL
FROM request.links
WHERE ParentItemID = #GetParents.ItemID#







It *seems* to me that cftree has a problem with a cftreeitem with value="0" and parent="0". If I remove the parent attribute (from the main template), the tree displays. Note, though, that the expand attribute that is set to Yes does not result in an expanded tree. This behavior is also incorrect. I plan to submit this to Macromedia as a bug as well, but I'm not sure it will fit in their bug form (it only allows 2000 characters in a text box the size of a credit card).



Calendar
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Recommended Reading
Coldfusion MX Developer's Handbook

Archives by Subject
Announcements (28)
ColdFusion (61)
Database (12)
Dreamweaver (1)
Flash (2)
Flash Remoting (2)
Flex (3)
General Development (2)
Homesite + (1)
Mach-II (3)
MAX (9)
Mozilla (2)
Music (1)
Politics (1)
Portals (2)
Travel (2)

Search

Links
CFLib.org
Raymond Camden's Blog
Christian Cantrell's Blog
Sean Corfield's Blog
Nathan Dintenfass' Blog
Todd Rafferty's Blog
Steve Rittler's Blog
Cameron Childress's Blog

Credits
Based on blog.cfc by Raymond Camden

XML Feed