First-off, and I don’t want to insult your intelligence, but you are perfectly sure that #request.portalObjectPath#.dataObjects.PortalParamsDAO evaluates to com.ipaper.timber.portal.dataObjects.PortalParamsDAO and that this component actually does exist in this location?

 

--Ferg

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Ferris
Sent: Friday, April 08, 2005 11:26 AM
To: [email protected]
Subject: Dynamic evaluation of ReturnType

 

We are busily designing objects to implement in a current application. (Thanks, Matt, et al for the introduction to OOP in CF).

 

One of the things we wanted to do was to dynamically evaluate the path to the objects.  (All other pathing in the application is evaluated dynamically).  This works fine when instantiating:

 

<cfset portalParamsDAO = CreateObject("component", "#request.portalObjectPath#.dataObjects.PortalParamsDAO").init(variables.dns)>
 

But when defining the function, CF seems to only want a literal when the ReturnType is a component name.  This fails with message of "The value of the attribute RETURNTYPE is invalid.":

 

<cffunction name="init" access="public" output="false" returntype="#request.portalObjectPath#.dataObjects.PortalParamsDAO" hint="Constructor for this CFC">

 

Instantiating works if we define the function like:

 

<cffunction name="init" access="public" output="false" returntype="com.ipaper.timber.portal.dataObjects.PortalParamsDAO" hint="Constructor for this CFC">

 

We have tried evaluate() and all kinds of formatting of the syntax, but can't get past this.  Anyone know how to make this work, or can confirm that you have to use the literal in the ReturnType?

 

Thanks,

Mike

Reply via email to