attributecollection

0 views
Skip to first unread message

Carol F

unread,
Nov 3, 2009, 8:15:27 PM11/3/09
to ColdSpring-Users
Hello everyone!

I have a structure named data:

<cfscript>
data = {};
data.from = "fr...@email.com";
data.to = "t...@email.com";
data.type = "plain";
data.subject = "test subject #now()#";
data.body = "test email #hash(now())#";
</cfscript>

I call a function from my coldspring factory and pass information from
this structure. This works:
<cfset APPLICATION.beanFactory.getBean("MailService").mailTo(from =
data.from, to=data.to, type=data.type, subject=data.subject,
body=data.body) />

But, this does not.
<cfset APPLICATION.beanFactory.getBean("MailService").mailTo
(attributecollection = "#data#") />

I get the error "coldfusion.runtime.MissingArgumentException: The FROM
parameter to the mailTo function is required but was not passed in."

How come specifying named parameters work, but when I do
attributecollection, it fails?

What's worse is that I tried the exact same thing with a simple CS
configuration, and it worked! Here's the code that worked:

<cfscript>
data = {};
data.arg1 = "hello";
data.arg2 = "goodbye";

xx = {};
xx.data = data;
xx.do1 = APPLICATION.beanFactory.getBean("test").doStuff(data.arg1,
data.arg2);
xx.do2 = APPLICATION.beanFactory.getBean("test").doStuff
(argumentcollection = data);
</cfscript>
<cfdump var="#xx#" />

So I verified that argumentcollection works, so it must be in the way
I set up my beans, or in the actual CFC code. Where do I start to
troubleshoot?

Joey

unread,
Nov 3, 2009, 11:01:40 PM11/3/09
to ColdSpring-Users
Hello Carol,

I'd start debugging your cfc, I had a similar problem, ended up being
real dodgy coding in my cfc.

- Joey

On Nov 4, 12:15 pm, Carol F <cfcn...@gmail.com> wrote:
> Hello everyone!
>
> I have a structure named data:
>
> <cfscript>
>         data = {};
>         data.from = "f...@email.com";

Mark Mandel

unread,
Nov 3, 2009, 11:13:59 PM11/3/09
to coldspri...@googlegroups.com
Although this doesn't seem like a ColdSpring specific question... it looks like you want 'argumentCollection', not 'attributeCollection'.

AttributeCollection is for tags.

Mark
--
E: mark....@gmail.com
T: http://www.twitter.com/neurotic
W: www.compoundtheory.com

Carol F

unread,
Nov 4, 2009, 2:50:18 PM11/4/09
to ColdSpring-Users
@Mark, that was it! argumentCollection works! Thanks!

On Nov 3, 8:13 pm, Mark Mandel <mark.man...@gmail.com> wrote:
> Although this doesn't seem like a ColdSpring specific question... it looks
> like you want 'argumentCollection', not 'attributeCollection'.
>
> AttributeCollection is for tags.
>
> Mark
>
>
>
> On Wed, Nov 4, 2009 at 12:15 PM, Carol F <cfcn...@gmail.com> wrote:
>
> > Hello everyone!
>
> > I have a structure named data:
>
> > <cfscript>
> >        data = {};
> >        data.from = "f...@email.com";
> E: mark.man...@gmail.com
Reply all
Reply to author
Forward
0 new messages