RE: Methods not found.
Thanks for all the help! I figured it out. Well, not really. I just moved everything around back to what I needed and it just worked. I might have maybe spelled variables wrong or something. LOL So odd. 2009/11/26 Chung Chow cyc...@annex.net Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328724 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
Hi Kevin. I've read that whole site a couple of days ago. Good stuff. But apart from making these utilities load in an application scope, I was trying to find a better way accesing them object-wide I guess. I'm worried aboout having to load all these utilities objects in a application variable. Right now it loads the system settings object. How much is too much objects when loading them into an application scope? Sorry for the questions. I just started to revert my programming thinking into an OOP stand point so I'm still sorting through all the damn terminology and concepts. You're unlikely to run into a problem loading shared objects into the Application scope. You're far more likely to run into memory ceilings when loading objects into the Session scope. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more informat ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328733 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Methods not found.
Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? Here's a sample of how I'm doing it. When I try to call addErrorMsg(); or isSuccess() or any methods in errorMsg or Imanage or instGateway it throws a Method not found error. cfcomponent displayname=feeds output=false ... cfscript var errorMsg = createObject(component, com.util.errorMessages).init(); var iManager = createObject(component, com.util.imageManager).init(); var instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript cffunction name=init access=public returntype=feeds hint=Constructor cfreturn this /cffunction cffunction name=insertFeedRecord access=public ... cfargument name=dataset required=true type=struct hint=Passed Dataset / cfscript var feedsBean = ; var newFileName = ; var instGatway = ; var results = structNew(); feedsBean = createObject(component, feedsBean).init(argumentCollection=dataset); // Validate the required fields and do an image upload if (not len(trim( feedsBean.getFeedName() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getFeedDescription() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getAuthorName() ))) errorMsg.addErrorMsg(...Blah); if (errorMsg.isSuccess()) { results.success = instGateway.create(feedsBean, errorMsg); results.errors = errorMsg.getErrors(); } else { results.success = 0; results.errors = errorMsg.getErrors(); } /cfscript cfreturn results / /cffunction /cfcomponent ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328697 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
I believe you would want : variables.errorMsg = createObject(component, com.util.errorMessages).init(); On Wed, Nov 25, 2009 at 3:36 PM, Chung Chow cyc...@annex.net wrote: Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? Here's a sample of how I'm doing it. When I try to call addErrorMsg(); or isSuccess() or any methods in errorMsg or Imanage or instGateway it throws a Method not found error. cfcomponent displayname=feeds output=false ... cfscript var errorMsg = createObject(component, com.util.errorMessages).init(); var iManager = createObject(component, com.util.imageManager).init(); var instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript cffunction name=init access=public returntype=feeds hint=Constructor cfreturn this /cffunction cffunction name=insertFeedRecord access=public ... cfargument name=dataset required=true type=struct hint=Passed Dataset / cfscript var feedsBean = ; var newFileName = ; var instGatway = ; var results = structNew(); feedsBean = createObject(component, feedsBean).init(argumentCollection=dataset); // Validate the required fields and do an image upload if (not len(trim( feedsBean.getFeedName() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getFeedDescription() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getAuthorName() ))) errorMsg.addErrorMsg(...Blah); if (errorMsg.isSuccess()) { results.success = instGateway.create(feedsBean, errorMsg); results.errors = errorMsg.getErrors(); } else { results.success = 0; results.errors = errorMsg.getErrors(); } /cfscript cfreturn results / /cffunction /cfcomponent ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328699 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Methods not found.
Gah, sorry. The sample is wrong. The psuedo constructor would look like this and in the cffunction would be called by the variables scope. variables.errorMsg.addErrorMsg() Sorry. was copy/pasting. cfcomponent displayname=feeds output=false ... cfscript variables.errorMsg = createObject(component, com.util.errorMessages).init(); variables.iManager = createObject(component, com.util.imageManager).init(); variables.instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript -Original Message- From: Chung Chow [mailto:cyc...@annex.net] Sent: Wednesday, November 25, 2009 12:37 PM To: cf-talk Subject: Methods not found. Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? Here's a sample of how I'm doing it. When I try to call addErrorMsg(); or isSuccess() or any methods in errorMsg or Imanage or instGateway it throws a Method not found error. cfcomponent displayname=feeds output=false ... cfscript var errorMsg = createObject(component, com.util.errorMessages).init(); var iManager = createObject(component, com.util.imageManager).init(); var instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript cffunction name=init access=public returntype=feeds hint=Constructor cfreturn this /cffunction cffunction name=insertFeedRecord access=public ... cfargument name=dataset required=true type=struct hint=Passed Dataset / cfscript var feedsBean = ; var newFileName = ; var instGatway = ; var results = structNew(); feedsBean = createObject(component, feedsBean).init(argumentCollection=dataset); // Validate the required fields and do an image upload if (not len(trim( feedsBean.getFeedName() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getFeedDescription() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getAuthorName() ))) errorMsg.addErrorMsg(...Blah); if (errorMsg.isSuccess()) { results.success = instGateway.create(feedsBean, errorMsg); results.errors = errorMsg.getErrors(); } else { results.success = 0; results.errors = errorMsg.getErrors(); } /cfscript cfreturn results / /cffunction /cfcomponent ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328701 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Methods not found.
Yeh Charlie. I sent a following email changing it. lol I was copy pasting the sample out of the cffunctions. lol Thanks. But that doesn't work either. :/ -Original Message- From: Charlie Stell [mailto:charlie.st...@gmail.com] Sent: Wednesday, November 25, 2009 12:54 PM To: cf-talk Subject: Re: Methods not found. I believe you would want : variables.errorMsg = createObject(component, com.util.errorMessages).init(); On Wed, Nov 25, 2009 at 3:36 PM, Chung Chow cyc...@annex.net wrote: Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? Here's a sample of how I'm doing it. When I try to call addErrorMsg(); or isSuccess() or any methods in errorMsg or Imanage or instGateway it throws a Method not found error. cfcomponent displayname=feeds output=false ... cfscript var errorMsg = createObject(component, com.util.errorMessages).init(); var iManager = createObject(component, com.util.imageManager).init(); var instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript cffunction name=init access=public returntype=feeds hint=Constructor cfreturn this /cffunction cffunction name=insertFeedRecord access=public ... cfargument name=dataset required=true type=struct hint=Passed Dataset / cfscript var feedsBean = ; var newFileName = ; var instGatway = ; var results = structNew(); feedsBean = createObject(component, feedsBean).init(argumentCollection=dataset); // Validate the required fields and do an image upload if (not len(trim( feedsBean.getFeedName() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getFeedDescription() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getAuthorName() ))) errorMsg.addErrorMsg(...Blah); if (errorMsg.isSuccess()) { results.success = instGateway.create(feedsBean, errorMsg); results.errors = errorMsg.getErrors(); } else { results.success = 0; results.errors = errorMsg.getErrors(); } /cfscript cfreturn results / /cffunction /cfcomponent ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328705 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
You should not be var'ing your constructor variables. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328704 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
Id check the following: That your referring to the CFC in the same way you are defining them. (since you say it works when defining with teh functions, I think this is most likely) The method-access on the other CFCs. That the init function of external CFCs are returning this. You could also instantiate them into the application scope, as long as they are thread-safe, and then refer to them via the application scope. Hope this helps! Gah, sorry. The sample is wrong. The psuedo constructor would look like this and in the cffunction would be called by the variables scope. variables.errorMsg.addErrorMsg() Sorry. was copy/pasting. cfcomponent displayname=feeds output=false ... cfscript variables.errorMsg = createObject(component, com.util.errorMessages).init(); variables.iManager = createObject(component, com.util.imageManager).init(); variables.instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328706 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
Id check the following: That your referring to the CFC in the same way you are defining them. (since you say it works when defining with teh functions, I think this is most likely) See if there is any difference made by instantiating them within the init function. The method-access on the other CFCs. That the init function of external CFCs are returning this. You could also instantiate them into the application scope, as long as they are thread-safe, and then refer to them via the application scope. Hope this helps! Gah, sorry. The sample is wrong. The psuedo constructor would look like this and in the cffunction would be called by the variables scope. variables.errorMsg.addErrorMsg() Sorry. was copy/pasting. cfcomponent displayname=feeds output=false ... cfscript variables.errorMsg = createObject(component, com.util.errorMessages).init(); variables.iManager = createObject(component, com.util.imageManager).init(); variables.instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript On Wed, Nov 25, 2009 at 4:00 PM, Chung Chow cyc...@annex.net wrote: Gah, sorry. The sample is wrong. The psuedo constructor would look like this and in the cffunction would be called by the variables scope. variables.errorMsg.addErrorMsg() Sorry. was copy/pasting. cfcomponent displayname=feeds output=false ... cfscript variables.errorMsg = createObject(component, com.util.errorMessages).init(); variables.iManager = createObject(component, com.util.imageManager).init(); variables.instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript -Original Message- From: Chung Chow [mailto:cyc...@annex.net] Sent: Wednesday, November 25, 2009 12:37 PM To: cf-talk Subject: Methods not found. Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? Here's a sample of how I'm doing it. When I try to call addErrorMsg(); or isSuccess() or any methods in errorMsg or Imanage or instGateway it throws a Method not found error. cfcomponent displayname=feeds output=false ... cfscript var errorMsg = createObject(component, com.util.errorMessages).init(); var iManager = createObject(component, com.util.imageManager).init(); var instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript cffunction name=init access=public returntype=feeds hint=Constructor cfreturn this /cffunction cffunction name=insertFeedRecord access=public ... cfargument name=dataset required=true type=struct hint=Passed Dataset / cfscript var feedsBean = ; var newFileName = ; var instGatway = ; var results = structNew(); feedsBean = createObject(component, feedsBean).init(argumentCollection=dataset); // Validate the required fields and do an image upload if (not len(trim( feedsBean.getFeedName() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getFeedDescription() ))) errorMsg.addErrorMsg(...Blah); if (not len(trim( feedsBean.getAuthorName() ))) errorMsg.addErrorMsg(...Blah); if (errorMsg.isSuccess()) { results.success = instGateway.create(feedsBean, errorMsg); results.errors = errorMsg.getErrors(); } else { results.success = 0; results.errors = errorMsg.getErrors(); } /cfscript cfreturn results / /cffunction /cfcomponent ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328707 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
RE: Methods not found.
Yup, checked all that. If I define them as variables. they don't work. Move them into the cffuction area and var them and they work fine. The method are access=public. Constructor returns THIS. I would instantiate them in a application scope but I don't want to do that JUST yet. BTW, what is the drawn back of defining a ton of objects into the application scope? (i.e. making a factory and defining the global used methods in the application.cfc?) Here's the error msg container code: cfcomponent displayname=errorMessages output=false hint=An error Auditor. Grabbing and using an Array cfset variables.instance = arrayNew(1) cffunction name=init access=public returntype=errorMessages hint=Constructor cfreturn this / /cffunction cffunction name=addErrorMsg access=public returntype=any cfargument name=message required=yes default= cfif len(trim(arguments.message)) cfset arrayAppend(variables.instance, arguments.message) / /cfif cfreturn variables.instance / /cffunction cffunction name=isSuccess access=public returntype=boolean cfif arrayLen(variables.instance)cfreturn false / cfelsecfreturn true //cfif /cffunction cffunction name=getErrors access=public returntype=array cfreturn variables.instance / /cffunction /cfcomponent -Original Message- From: Charlie Stell [mailto:charlie.st...@gmail.com] Sent: Wednesday, November 25, 2009 1:03 PM To: cf-talk Subject: Re: Methods not found. Id check the following: That your referring to the CFC in the same way you are defining them. (since you say it works when defining with teh functions, I think this is most likely) The method-access on the other CFCs. That the init function of external CFCs are returning this. You could also instantiate them into the application scope, as long as they are thread-safe, and then refer to them via the application scope. Hope this helps! Gah, sorry. The sample is wrong. The psuedo constructor would look like this and in the cffunction would be called by the variables scope. variables.errorMsg.addErrorMsg() Sorry. was copy/pasting. cfcomponent displayname=feeds output=false ... cfscript variables.errorMsg = createObject(component, com.util.errorMessages).init(); variables.iManager = createObject(component, com.util.imageManager).init(); variables.instGateway = createObject(component, FeedsGateway).init(application.global); /cfscript ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328708 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Methods not found.
I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) You may like to take a look at 'dependecy injection' techniques http://learn.objectorientedcoldfusion.org/wiki/Dependency_Injection 2009/11/26 Chung Chow cyc...@annex.net Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328709 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
Try the following - Add a function to your cfc that will return variables.X - X being whatever instantiated cfc you cant call the function of. Dump the results of new function - this should help you debug. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328710 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Methods not found.
Hi Kevin. I've read that whole site a couple of days ago. Good stuff. But apart from making these utilities load in an application scope, I was trying to find a better way accesing them object-wide I guess. I'm worried aboout having to load all these utilities objects in a application variable. Right now it loads the system settings object. How much is too much objects when loading them into an application scope? Sorry for the questions. I just started to revert my programming thinking into an OOP stand point so I'm still sorting through all the damn terminology and concepts. -Original Message- From: Kevan Stannard [mailto:ke...@stannard.net.au] Sent: Wednesday, November 25, 2009 1:56 PM To: cf-talk Subject: Re: Methods not found. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) You may like to take a look at 'dependecy injection' techniques http://learn.objectorientedcoldfusion.org/wiki/Dependency_Injection 2009/11/26 Chung Chow cyc...@annex.net Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328712 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Methods not found.
If you create all of your application wide objects once on application startup then it's unlikely you will reach any limit. I would imagine that a small application would have less than 10 application scoped objects, whereas a very large application may need 50 or so, just to pick a few numbers out of the air. 2009/11/26 Chung Chow cyc...@annex.net Hi Kevin. I've read that whole site a couple of days ago. Good stuff. But apart from making these utilities load in an application scope, I was trying to find a better way accesing them object-wide I guess. I'm worried aboout having to load all these utilities objects in a application variable. Right now it loads the system settings object. How much is too much objects when loading them into an application scope? Sorry for the questions. I just started to revert my programming thinking into an OOP stand point so I'm still sorting through all the damn terminology and concepts. -Original Message- From: Kevan Stannard [mailto:ke...@stannard.net.au] Sent: Wednesday, November 25, 2009 1:56 PM To: cf-talk Subject: Re: Methods not found. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) You may like to take a look at 'dependecy injection' techniques http://learn.objectorientedcoldfusion.org/wiki/Dependency_Injection 2009/11/26 Chung Chow cyc...@annex.net Hi all, I'm trying to instantiate an object either in the psuedo-contructor or init of my cfc as a variable so I can use it within all my method inside that cfc. For some reason when I call a method from that object I get a Method not found error. I'm not sure if this is the best way of going about it so if anyone has a better idea, I'd like to hear about it. :) If I istantiate it WITHIN the cffunction, it works fine. Any ideas? ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:328722 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4