[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/20/2009 at 02:20PM PDT, ID: 24585626 | Points: 250
[x]
Attachment Details

JavaScript error in the ColdFusion-generated CFTree.js file.

Asked by jaloving in ColdFusion Studio, ColdFusion Application Server

Tags: ColdFusion 8, CFTree

I am using <CFTree> to display databases and tables found on a system, based on datasources in ColdFusion 8. I retrieve the information from the system tables and loop through the query to create the tree, in collapsed mode (databases only, but not expanded to show tables). Everything initially appears fine, except when I click on one of the tables, I get a JavaScript error. I'm using IE 7 on a Vista Business 32-bit system with debugging enabled. The error is: "A Runtime error has occurred. Do you wish to Debug? Line 247. Error: 'style' is null or not an object." When I open the debugger, it is displaying "cftree.js" which is definitely not one of my files. Since I cannot fine it in the CFIDE folder, I have to assume that it is a ColdFusion-generated file to support cftree. Line 247 is: '_68.style.backgroundColor="lightblue";' On top of it all, it doesn't matter which table I click on, I get the same error, which is toward the end of the file. The code to create the tree is below and attached is the cftree.js file that I captured (as cftree.txt). The two links (displayTable and displayColumn) are to JavaScript functions to fill in some detail fields according to what is clicked. After the error, those field are filled in correctly, so it doesn't appear as though that code is a contributing factor.
Does anyone have any idea how to fix this problem? I've uninstalled and reinstalled ColdFusion with the same results. I've used <cftree> before with no problems until now. In fact, old programs with <cftree> still run fine, so I hope I'm just missing something simple.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
<cftree name="schemaTree" width="300px" appendkey="yes" completepath="yes" format="html">
            <cfloop query="schemaList">
            <cfif schemaList.column_id eq 0>
                <cftreeitem value="0" display="#schemaList.Tablename#" img="document" expand="#IIF(schemaList.Tablename eq tblName, 'true', 'false')#" 
                    href="JavaScript: displayTable('#schemaList.Tablename#', #schemaList.object_id#, '#schemaList.PropertyType#', '#schemaList.PropertyValue#');">
            <cfelse>
                <cftreeitem value="#schemaList.column_id#" img="element" parent="0" expand="#IIF(schemaList.ColumnName eq colName, 'true', 'false')#" 
                    display="#schemaList.ColumnName#" 
                    href="JavaScript: displayColumn(#schemaList.object_id#, #schemaList.column_id#, '#schemaList.ColumnName#', '#schemaList.PropertyType#', '#schemaList.PropertyValue#');">
            </cfif>
            </cfloop>
        </cftree>
Attachments:
 
This is the captured ColdFusion-generated cftree.js file.
 
[+][-]07/30/09 11:31 AM, ID: 24982939

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/30/09 11:34 AM, ID: 24982974

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/25/09 08:46 AM, ID: 25178813

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/25/09 02:49 PM, ID: 25182643

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20090824-EE-VQP-74 - Hierarchy / EE_QW_3_20090701_SELECT_ZONES