HOME | FERGUSON Digital Blog

Entries for month: December 2010

Clicking CFTREE Too Fast

ColdFusion · By Michael Ferguson No Comments »

I was recently working on a ColdFusion 9 project using CFTREE and CFLAYOUT together. The project called for user selection of the tree icons that would cause navigation panels in the layout to display different directory contents and provide the appropriate edit menus.

Everything was working as planned, after applying some new logic and adding the decorative icons and balanced color schemes. While alpha testing I noticed that the tree would occasionally fail to trigger the layout panel and you would be left with partial content and rouge JavaScript errors. This was battled for about a week. Line by line the code was checked for flaws, the data was checked, the database was checked, and then begrudgingly the ColdFusion built-in Ajax was examined. The error message was simply that the layout panel was undefined.

When all lines of code involved were completely examined and nothing obvious could be found, we turned our attention to reproducing the actual error. It seemed as though it could happen to any content from any position in the tree. The real kicker was that it could only be triggered if the user would rapidly click on the tree nodes. The first fix-candidate was a two second timeout applied to the tree whenever a node was clicked, but this slowed the application down and was generally irritating. Utilizing the windows "onerror" event was eventually settled on as a fix. When triggered, thanks to rapidly clicking on a tree node, the event listener simply reloaded the layout area and flushed the client error notice.

The bottom line though, is that when combined with the CFLAYOUT, the CFTREE tag in ColdFusion 9 (no other versions have been tested) will generate a client side JavaScript error when the user clicks on any tree node too quickly in rapid succession. If you have these tags combined, users will click, over-click, and rapid click; so you may need to develop your own mechanism to capture and deal with the client side error event.

If you find this post useful please leave a comment and let me know how you used the information.

Exception Thrown CFAJAX.js Line 90

ColdFusion · By Michael Ferguson 2 Comments »

I was working with CFMESSAGEBOX and kept getting the client side error that there was an exception thrown and not caught, the culprit was identified as the "CFAJAX.JS" file on line 90.

There really isn't anything wrong this the JS file, the problem is that when you call CFMESSAGEBOX from an ajax page, there is little you have to do, but when you are calling it from a page without any other ajax and you receive the error; just be sure to use the "AjaxOnload" command to execute at the bottom of your page.

If you find this post useful please leave a comment and let me know how you used the information.

Add HTML To CFLayout Title

ColdFusion · By Michael Ferguson No Comments »

Did you know that you can add HTML items to the title of a CFLAYOUTAREA?οΎ  This works out really well if you would like to include an icon or special button that is completely independent of the content being displaying inside the layout.

<cfset IconFolder="<img src="&Chr(34)&"/Info.png"&Chr(34)&" width=20 height=20 />">

<cflayout type="border" name="PanelParent" align="left" fittowindow="yes">
   <cflayoutarea position="left" title="#IconFolder# INSTRUCTIONS" size="250">
      Stuff
   </cflayoutarea>
</cflayout>

The code above will place an icon in the title just before the word "instructions". Hope you can find a good use for this one! Enjoy!

If you find this post useful please leave a comment and let me know how you used the information.

© Copyright 1997-2024, All Rights Reserved Coldfusion and MS SQL2008
Powered by Mango Blog.   Design by FERGUSON Digital