Sure that didn't think that was what you where referring too.
On Wed, Jul 20, 2011 at 11:24 AM, Paul Kukiel kuki...@gmail.com wrote:
Yep,
What I am referring to is that you can dynamically set the return type ie
cfunction name=init returnType=#dynamicReturnType# /
or
cfunction
Yep,
What I am referring to is that you can dynamically set the return type ie
cfunction name=init returnType=#dynamicReturnType# /
or
cfunction name=init returnType=#getMetaData(this).Name# /
They will both fail.
The return type must be specified at compile time ie
cfunction name=init
Paul, I am going to correct you here.
When creating the constructor, whether it be init or initmethod=whatever
you can return the object type.
public testComponent function() {
}
Also notice that I didn't include the return this, because in ColdFusion 9
this will work without it. What you can't
When using either the new operand or the createObject in CF9 will not
require you to use the init() call after it.
Sorry to point this out to you.
On Thu, Jul 14, 2011 at 8:19 PM, Paul Kukiel kuki...@gmail.com wrote:
Also as a small note the init method is called automatically when you use
Maybe it was a CF9.01 change then!!
But try this page
http://andyscott.id.au/andrewscott/
and here is the code.
cfscript
writeOutput('Using CreateObject..');
test = CreateObject(component,test);
writeDump(test);
writeOutput('Using new operand..');
test1 = new test();
writeDump(test1);
Well your correct in that createObject returns this ( ie the instance )
but it dosn't run init(). Try put a writeOutput or dump in the init method
then running it both ways on that test page, new Test(); will display the
output but create object wont.
I just checked my cf9 server and it's 9.01
Yeah you are right, I was just about to comment that back.
So the docs are right and there is no change here, so if you do want to use
createObject() and you have the initMethod() to setup some things then the
rule you applied does apply.
On Mon, Jul 18, 2011 at 10:06 PM, Paul Kukiel
How would you even do it createObject?
createObject(component, foo)() ?
probably why you cant do it J
From: Andrew Scott [mailto:andr...@andyscott.id.au]
Sent: Monday, 18 July 2011 10:08 PM
To: cfaussie@googlegroups.com
Subject: Re: [cfaussie] Re: CreateObject of itself
Yeah you
”)() ?
** **
probably why you cant do it J
** **
*From:* Andrew Scott [mailto:andr...@andyscott.id.au]
*Sent:* Monday, 18 July 2011 10:08 PM
*To:* cfaussie@googlegroups.com
*Subject:* Re: [cfaussie] Re: CreateObject of itself
** **
Yeah you are right, I was just about to comment
within that CFC i can make a
call new FooBar() and i will have a new instance of the CFC?
-Original Message-
From: Paul Kukiel [mailto:kuki...@gmail.com]
Sent: Thursday, 14 July 2011 8:55 AM
To: cfaussie
Subject: [cfaussie] Re: CreateObject of itself
Hi Steve,
I believe
Subject: [cfaussie] Re: CreateObject of itself
Hi Steve,
I believe this is what your trying to achieve:
http://pastebin.com/hJmsEvaA
Running code: http://demo.kukiel.net/cfaussie.cfm
Paul
On Jul 13, 8:37 pm, Steve Onnis st...@cfcentral.com.au wrote:
Can anyone suggest a way i can
a new instance of the CFC?
-Original Message-
From: Paul Kukiel [mailto:kuki...@gmail.com]
Sent: Thursday, 14 July 2011 8:55 AM
To: cfaussie
Subject: [cfaussie] Re: CreateObject of itself
Hi Steve,
I believe this is what your trying to achieve:
http://pastebin.com/hJmsEvaA
To: cfaussie
Subject: [cfaussie] Re: CreateObject of itself
Hi Steve,
I believe this is what your trying to achieve:
http://pastebin.com/hJmsEvaA
Running code: http://demo.kukiel.net/cfaussie.cfm
Paul
On Jul 13, 8:37 pm, Steve Onnis st...@cfcentral.com.au wrote:
Can anyone suggest a way i can
Ok so if i have a cfc named FooBar.cfc, from within that CFC i can make a
call new FooBar() and i will have a new instance of the CFC?
-Original Message-
From: Paul Kukiel [mailto:kuki...@gmail.com]
Sent: Thursday, 14 July 2011 8:55 AM
To: cfaussie
Subject: [cfaussie] Re: CreateObject
14 matches
Mail list logo