populate: n00b error?

14 views
Skip to first unread message

cf_sarahk

unread,
Jan 29, 2012, 2:57:30 PM1/29/12
to framework-one
ARG[KEY] parameter to the set[Key] function was required but not
passed in.

I just started learning FW/1 along with MVC in general and OO in CF.
For trying to do it all at once, I think I'm making pretty good
progress;)

I'm not sure if I'm misunderstanding how populate works, or if I
simply have errors in how I'm referencing my objects. Are the
following two lines of code equivalent (or roughly so)?
<cfset dum2 = app.setAppId(Arguments.rc.appID) />
<cfset variables.fw.populate(app,"appID") />

The first seems to work, while the second throws an error:
ARGAPPID parameter to the setAppID function was required but not
passed in.

Before I started troubleshooting, I actually had the populate line as
<cfset variables.fw.populate(app) />
In that case it seemed to randomly pick a key to throw the error
about. One time I would test it and the error would be about appID and
another time about appTitle or any of the other keys. I did not notice
any pattern to the order in which it threw these errors (and it only
threw one at a time).

Thanks for any help you can give in either helping me understand
populate or in learning where to look to find the error.

Sarah

Sean Corfield

unread,
Jan 30, 2012, 4:51:39 PM1/30/12
to framew...@googlegroups.com
On Sun, Jan 29, 2012 at 11:57 AM, cf_sarahk <skc...@gmail.com> wrote:
> I'm not sure if I'm misunderstanding how populate works, or if I
> simply have errors in how I'm referencing my objects. Are the
> following two lines of code equivalent (or roughly so)?
>   <cfset dum2 = app.setAppId(Arguments.rc.appID) />
>   <cfset variables.fw.populate(app,"appID") />
>
> The first seems to work, while the second throws an error:
>  ARGAPPID parameter to the setAppID function was required but not
> passed in.

The convention assumes that the argument to setFoo() is called foo.
Your setAppID() method should have a single argument named appID.

Perhaps if you could show code and the stack trace, we'd be able to
help you better?
--
Sean A Corfield -- (904) 302-SEAN
An Architect's View -- http://corfield.org/
World Singles, LLC. -- http://worldsingles.com/

"Perfection is the enemy of the good."
-- Gustave Flaubert, French realist novelist (1821-1880)

cf_sarahk

unread,
Jan 30, 2012, 8:22:48 PM1/30/12
to framework-one
I hate missing obvious stuff!! Your answer must have the words in a
different order than in the docs I've read over and over. I'm not
sure how I went down the wrong path to begin with, but I had the arg
in setFoo() named argFoo rather than foo. And then I guess I'd looked
at it for so long that I couldn't see the difference.

arrggh!!

and THANKS:)

sk

On Jan 30, 4:51 pm, Sean Corfield <seancorfi...@gmail.com> wrote:
> On Sun, Jan 29, 2012 at 11:57 AM, cf_sarahk <skco...@gmail.com> wrote:
> > I'm not sure if I'm misunderstanding how populate works, or if I
> > simply have errors in how I'm referencing my objects. Are the
> > following two lines of code equivalent (or roughly so)?
> >   <cfset dum2 = app.setAppId(Arguments.rc.appID) />
> >   <cfset variables.fw.populate(app,"appID") />
>
> > The first seems to work, while the second throws an error:
> >  ARGAPPID parameter to the setAppID function was required but not
> > passed in.
>
> The convention assumes that the argument to setFoo() is called foo.
> Your setAppID() method should have a single argument named appID.
>
> Perhaps if you could show code and the stack trace, we'd be able to
> help you better?
> --
> Sean A Corfield -- (904) 302-SEAN
> An Architect's View --http://corfield.org/
> World Singles, LLC. --http://worldsingles.com/

Sean Corfield

unread,
Jan 30, 2012, 8:35:34 PM1/30/12
to framew...@googlegroups.com
Glad I could help!
Reply all
Reply to author
Forward
0 new messages