Hi,
I'm running CF 9.01 and have a ColdBox 3.1 application that uses
modules. I'm trying to learn how to leverage Wirebox and had a
question if my code looks okay.
I'm building a screen where I can edit a user's details. I have a
handler with this code:
<cffunction name="edituser" access="public" returntype="void">
<cfargument name="Event" type="any" required="yes" />
<cfset var rc = event.getCollection() />
<cfset var injector =
createObject("component","coldbox.system.ioc.Injector").init() />
<cfset var populator = injector.getObjectPopulator() />
<cfset var objUserBean =
injector.getInstance("modules.moduleName.model.UserBean").init() />
<cfset Event.setValue('qUser',
instance.UserManager.getUser( rc.user_Id ) ) />
<cfset objUserBean = populator.populateFromQuery( objUserBean,
rc.qUser ) />
<cfset Event.setView(name="usermanager/
vwEditUser",layout='Layout.ModuleName') />
</cffunction>
I feel like that is a lot of code to get my bean populated. Am I
doing to much here? What can I do to shorten this code.
Any help appreciated
-West