I'm not familiar enough with Mach II to tell you specifically, but I do know
that most of the frameworks have a method available whose purpose in life is
to take the incoming event arguments and automatically populate a bean.
Model Glue has it's "makeEventBean" method, Coldbox has it's
"beanfactory.populateBean" method. Here's a sample from my Coldbox app
(using Transfer) to accomplish what you're talking about. Hopefully you'll
be able to translate it to Mach II:
<cfif structkeyexists(arguments.event.getCollection(),"id")>
<cfset targetTemplate =
variables._transfer.get("template.template",arguments.event.getValue("id")
/>
<cfelse>
<cfset targetTemplate = variables._transfer.new("template.template") />
</cfif>
<!--- stuff the supplied values into the bean... --->
<cfset variables._beanfactory.populateBean(targetTemplate) />
<!--- commit changes to db... --->
<cfset variables._transfer.save(targetTemplate) />
<cfset retval = targetTemplate.getID() />
On Tue, Jan 20, 2009 at 6:45 PM, Jorge Loyo <[email protected]> wrote:
>
> I am new to transfer and I am having trouble with this.
>
> I am currently using Mach-II and the "<event-bean>" in an event-
> handler.
>
> If I submit a request to save a new user how can i use my event
> arguments to populate a transfer object that i can use to save the new
> record.
>
> thank you
> >
>
--~--~---------~--~----~------------~-------~--~----~
Before posting questions to the group please read:
http://groups.google.com/group/transfer-dev/web/how-to-ask-support-questions-on-transfer
You received this message because you are subscribed to the Google Groups
"transfer-dev" 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/transfer-dev?hl=en
-~----------~----~----~----~------~----~------~--~---