Hi John,

Give this a shot:

<cfloop collection="#search_stuff#" item="place">
  #search_stuff[place]#<br>
</cfloop>

-Dain

-----Original Message-----
From: John Stanley [mailto:[EMAIL PROTECTED]
Sent: Tue 11/4/2003 11:18 AM
To: CF-Talk
Cc:
Subject: COM Object Misery
Wrong subject in last post....sorry about that

Hello everyone. Okay I got connected to my COM object. I can view individual
server properties or results from methods that are simple objects. What I
cannot do is view the results from a Complex Object Type like the
"search_stuff " variable below. I know there is a CFMX bug that does not
allow the cfdump tag to be used in this instance, but whatever method I try
gives me either the cannot display Complex Objects error message or the
there is no method called Item MX bug (Bug # 44527). I think I can do this
with a loop, but am unsure how to proceed  because I dont know what
delimiters are being used. I have tried to test to see if the object is an
array using ArrayLen and got the following error (Object of type class
coldfusion.runtime.com.ComProxy cannot be used as an array), so that's out.


So i tested the object as a structutre using the isStruct function and it
came back with "Yes".


So then I created a structure loop:


<cfloop collection="#search_stuff#" item="place">
  #place#<br>
</cfloop>


and get the good old error (java.lang.NoSuchMethodException: There is no
method called Item.)


So cold fusion recognizes the object as a structure, but cannot, at least in
the syntax I am using display it's contents.


There has got to be a way to display this COM data in CF.


See my code below for reference.



<cfif NOT isDefined("miler")>
<cfobject action="" type="COM" class="PCMServer.PCMServer.1"
name="miler">
</cfif>


<cfset this_id = miler.ID>
<cfset this_name = miler.ProductName>
<cfset version = miler.ProductVersion>
<cfset valid = miler.valid>
<cfset errorcode = miler.errorcode>
<cfset numregions = miler.numregions>
<cfset debuglevel = miler.debuglevel>
<cfset defaultregion = miler.defaultregion>
<cfset this_trip = miler.NewTrip("#defaultregion#")>
<cfset testing = miler.CalcDistance2("Belleville, Mi","Waterford, Mi",2)>
<cfset search_stuff = miler.GetPickList("Belleville, Mi","NA",2)>


<cfoutput>


#this_id#<br>#this_name#<br>#version#<br>#valid#<br>#errorcode#<br>#numregio
ns#<br>#debuglevel#<br>#defaultregion#<br>#this_trip.ID#<br>#testing#
<cfloop collection="#search_stuff#" item="place">
  #place#<br>
</cfloop>
</cfoutput>


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to