> I have created an object in my Application.cfm, 
> (<cfobject type="COM" class="BHCSPortalUserObjects.CEntities" 
> name="entitiesCollection" action="CREATE">)
> and I can access any object property in the Application.cfm. 
> What I am trying to do now is to access the collection in 
> other templates. For instance, I have this code:
> 
> <select name="EntityID">
>   <cfloop collection="#entitiesCollection#" item="Names">
>    <cfoutput>
>       <option value="#Names.EntityID#">#Names.EntityName#
>   </cfoutput>
>  </cfloop>
> </select>
> 
> What I get is this:
>  An error occurred while evaluating the expression: 
> "#entitiesCollection#"
> 
> I have been looking through my documentation, and I cannot 
> find out why I cannot access the collection is another page 
> below the application.cfm. 
> 
> Any thoughts? We have not been working a whole lot with COM 
> objects here, but we are going to be relying on them more and 
> more in the near future.

There are lots of odd things about how COM objects work from CF. I haven't
tried instantiating one from Application.cfm, because in general, I think
that's a bad idea - do you really want to instantiate and destroy the object
in each page request? That may be better than persisting the object in
memory, though - that has its own set of problems.

So, if you find yourself wanting to do this, you might try scoping the
object in the Request scope. I don't know if that'll work, but it's worth a
shot.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to