MG 1.1 - adding an object to the event mystery

0 views
Skip to first unread message

Al

unread,
Jul 23, 2008, 12:54:27 PM7/23/08
to model-glue
I'm getting an error that doesn't make any sense. (This is ModelGlue
1.1.)

Here's a function from my controller:

<cffunction name="getAssignmentLookupTool" access="public"
returntype="void" output="false" hint="I am an event handler.">
<cfargument name="event" type="any" required="yes" />
<cfset var dsn=GetModelGlue().getConfigSetting("dsn") />
<cfset var
dateCode=arguments.event.getValue("currentMeeting").getDateCode() />
<cfset var
assignmentLookup=createObject("component","TLA.model.AssignmentLookup").init(dsn,councilDateCode) /
>
<cfset arguments.event.setValue("assignmentLookup",assignmentLookup) /
>
</cffunction>

I am getting the following error on the setValue() line:

Variable ASSIGNMENTLOOKUP is undefined.

I am baffled.

dsn and dateCode have valid values. I can see in the debugging that
the query in AssignmentLookup's init() is firing. There's no code
between the creation of the object in the var scope and using it in
the setValue. Where is it going?

I feel like I'm overlooking something obvious, but I haven't the
foggiest idea what it is. Any ideas?

Dan Wilson

unread,
Jul 23, 2008, 12:56:09 PM7/23/08
to model...@googlegroups.com
Al,

Make sure your init function is returning the reference to the Assignment look Up component.

<cfreturn this />


DW
--
"Come to the edge, he said. They said: We are afraid. Come to the edge, he said. They came. He pushed them and they flew."

Guillaume Apollinaire quotes

Al

unread,
Jul 23, 2008, 12:58:12 PM7/23/08
to model-glue
Yeah. Not 30 seconds after I hit send I realized the problem. Ugh.

Thanks.

On Jul 23, 12:56 pm, "Dan Wilson" <sipac...@gmail.com> wrote:
> Al,
>
> Make sure your init function is returning the reference to the Assignment
> look Up component.
>
> <cfreturn this />
>
> DW
>
>
>
>
>
> On Wed, Jul 23, 2008 at 12:54 PM, Al <everett...@gmail.com> wrote:
>
> > I'm getting an error that doesn't make any sense. (This is ModelGlue
> > 1.1.)
>
> > Here's a function from my controller:
>
> > <cffunction name="getAssignmentLookupTool" access="public"
> > returntype="void" output="false" hint="I am an event handler.">
> >        <cfargument name="event" type="any" required="yes" />
> >        <cfset var dsn=GetModelGlue().getConfigSetting("dsn") />
> >        <cfset var
> > dateCode=arguments.event.getValue("currentMeeting").getDateCode() />
> >        <cfset var
> > assignmentLookup=createObject("component","TLA.model.AssignmentLookup").ini­t(dsn,councilDateCode)
> > /
>
> >        <cfset arguments.event.setValue("assignmentLookup",assignmentLookup)
> > /
>
> > </cffunction>
>
> > I am getting the following error on the setValue() line:
>
> > Variable ASSIGNMENTLOOKUP is undefined.
>
> > I am baffled.
>
> > dsn and dateCode have valid values. I can see in the debugging that
> > the query in AssignmentLookup's init() is firing. There's no code
> > between the creation of the object in the var scope and using it in
> > the setValue. Where is it going?
>
> > I feel like I'm overlooking something obvious, but I haven't the
> > foggiest idea what it is. Any ideas?
>
> --
> "Come to the edge, he said. They said: We are afraid. Come to the edge, he
> said. They came. He pushed them and they flew."
>
> Guillaume Apollinaire quotes- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages