Hi Steve

If you're just trying to avoid referencing the component name within itself, then why not try using

local.metaData = GetMetaData(this);
local.tmpObj = CreateObject("component", local.metaData.fullname).init();

You might want to check the docs to see if fullname is the correct key to reference, but this sort of idea should allow you to create an instance of the CFC you're currently in.

Phil


On 13/07/11 8:37 PM, Steve Onnis wrote:

Can anyone suggest a way i can create a new reference to a cfc that i am already in?

Something like....

FooBar.cfc

<cfcomponent>

<cfproperty name="fooProp" type="string" />

<cffunction name="bar" output="false">

<cfscript>

                  LOCAL.tmpArr = [];

*for* (LOCAL.i = 1; LOCAL.i LTE 10; LOCAL.i = LOCAL.1+1) {

                        LOCAL.tmpObj = *new* this_;_

                        LOCAL.tmpObj.setfooBar("Some String #LOCAL.i#");

*ArrayAppend*(LOCAL.tmpArr, LOCAL.tmpObj);

}

</cfscript>

</cffunction>

</cfcomponent>

Obviously "new this;" wont work.

I want something to replace

LOCAL.tmpObj = *createObject*("COMPONENT", "FooBar");

Ideas?

Steve

--
You received this message because you are subscribed to the Google Groups "cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to cfaussie+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en.

--
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com.
To unsubscribe from this group, send email to 
cfaussie+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/cfaussie?hl=en.

Reply via email to