I am creating a XML tree. The childs[i].lastversionid element is not available, 
and I am aware of. But, instead of executing the cfcatch part (which creates 
XML data with the error data in it to show in a treeview) CFMX just throws the 
error. Anybody happen to have same issues before with cftry/cfcatch ?
 
The relevant code is posted below :) Maybe I have triggered a known issue? The 
code resides in a cfm file, not in a cfc.
 
 
 <cfset dataset = 
createObject("component",server.io.getCFCPath("shared","getchildren"))>
 <cfset dataset.init(parentid=url.parentid)>
 <cfset childs = dataset.getAsObjects()>
 
 <cftry>
 <cfloop from="1" to="#ArrayLen(childs)#" index="i">
  <cfif childs[i]["objectName"] EQ "LibraryCategory" AND childs[i]["forObject"] 
EQ Request.Object.object_Article.type>
  <cfoutput>
  <tree 
   label="#childs[i]["objectlabel"]#" 
   
src="object.cfm?object=article&amp;template=treenodes&amp;parentid=#childs[i]["instanceid"]#"
 
   icon="styles/blue/gfx/workset.gif"
   iconopen="styles/blue/gfx/workset.gif"
   instanceid="#childs[i]["instanceid"]#"
   lastversionid="#childs[i]["lastversionid"]#"
   parentid="#childs[i]["parentid"]#"
   joininstanceid="#childs[i]["joininstanceid"]#"
   objecttype="#childs[i]["objecttype"]#"
   objectname="#childs[i]["objectname"]#"
   basedir="#evaluate('request.application.object.object_' & 
childs[i]['objectname'] & '.location')#"
   />
  </cfoutput>
  </cfif> 
 </cfloop>
 <cfcatch>
  <cfoutput>
  <tree 
   label="error:#xmlFormat(cfcatch.message)#"
   <cfloop collection="#cfcatch#" item="cfcatchAttribute">
   <cfif isSimpleValue(cfcatch[cfcatchAttribute])>
    #cfcatchAttribute#="#xmlFormat(cfcatch[cfcatchAttribute])#"
   <cfelseif isArray(cfcatch[cfcatchAttribute])>
    <cfloop from="1" to="#ArrayLen(cfcatch[cfcatchAttribute])#" index="i">
     <cfif isStruct(cfcatch[cfcatchAttribute][i])>
      <cfloop collection="#cfcatch[cfcatchAttribute][i]#" 
item="cfcatchSubAttribute">
       
#cfcatchAttribute#_#i#_#cfcatchSubAttribute#="#xmlFormat(cfcatch[cfcatchAttribute][i][cfcatchSubAttribute])#"
      </cfloop>
     <cfelseif isSimpleValue(cfcatch[cfcatchAttribute][i])>
      #cfcatchAttribute#_#i#="#xmlFormat(cfcatch[cfcatchAttribute][i])#"
     </cfif>
    </cfloop>
   </cfif>
   </cfloop>
   icon="styles/blue/gfx/error.gif"
   iconopen="styles/blue/gfx/error.gif" 
   iserror="true" 
   onloadevent="new function(){alert('expand this node automatically, = 
node.expand()')}"/>
  </cfoutput>
 </cfcatch>
 </cftry>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:193136
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to