And just to follow up on Dennis' suggestion, once you have added your
bean as a value in the event, in addition to retrieving it using the
event.getValue() method, you can also use event.copyToScope() in order
to pull several values out of the event:

http://docs.model-glue.com/wiki/HowTos/HowToUseEventCopyToScope

--
Ezra Parker



On Fri, Dec 11, 2009 at 9:19 AM, Dennis Clark <[email protected]> wrote:
> Try adding the following line to the end of your getAdvice method:
>
> <cfset arguments.event.setValue('Advice',bean)>
>
> Dennis
>
> On Fri, Dec 11, 2009 at 12:12 PM, Jeremy Rottman <[email protected]> wrote:
>>
>> I am working on converting one of the simpler portions of my
>> application to MG. I am trying to reuse alot of my existing ColdSpring
>> code to save myself a bit of time.
>>
>> Right now I am working on the controller for this particular section
>> and having a bit of trouble understanding how the returns work.
>>
>> I have my Service Bean for this particular model: AdviceService.
>> Within AdviceService I have the method getAdvice(required int) that
>> returns the bean AdviceBean.
>>
>> I have the code below for my AdviceController. I am just not sure
>> exactly how to return the data I get from getAdvice() from within my
>> controller method. Can someone point me in the right direction?
>>
>> <cfcomponent output="false" hint="AdviceController"
>> extends="ModelGlue.gesture.controller.Controller"
>> beans="AdviceService">
>>
>>
>>
>>        <cffunction name="init" access="public" output="false"
>> hint="Constructor">
>>                <cfargument name="framework" />
>>
>>                <cfset super.init(framework) />
>>
>>                <cfreturn this />
>>        </cffunction>
>>
>>
>>        <cffunction name="getAdvice" access="public" output="false">
>>                <cfargument name="event" type="Any">
>>
>>                        <cfset var AdviceID     =
>> arguments.event.getValue('AuthorID')>
>>                        <cfset var bean                 =
>> beans.AdviceService.getAdvice(AdviceID)>
>>
>>
>>
>>        </cffunction>
>>
>> --
>> Model-Glue Sites:
>> Home Page: http://www.model-glue.com
>> Documentation: http://docs.model-glue.com
>> Bug Tracker: http://bugs.model-glue.com
>> Blog: http://www.model-glue.com/blog
>>
>> You received this message because you are subscribed to the Google
>> Groups "model-glue" group.
>> To post to this group, send email to [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://groups.google.com/group/model-glue?hl=en
>
> --
> Model-Glue Sites:
> Home Page: http://www.model-glue.com
> Documentation: http://docs.model-glue.com
> Bug Tracker: http://bugs.model-glue.com
> Blog: http://www.model-glue.com/blog
>
> You received this message because you are subscribed to the Google
> Groups "model-glue" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/model-glue?hl=en

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to