Hi,
That helps quite a bit.
Two questions arise.
1. Can you explain the dynamic class usuage and why one might use that?
2. I always see VO's with an empty function declared after the
properties (see below) , why is this?
public function securityVO()
{
}
Thanks for your help
-M
--- In [email protected], "Douglas Knudsen"
<[EMAIL PROTECTED]> wrote:
>
> you need a EmployeeVO CFC with matching properties and the full array
of
> mutators and accessors. Further you need to add the metadata to your
AS VO
> so Flex knows how to tie it in to your CFC. THen service.saveEmployee(
> employeeVO ) can work on the EmployeeVO CFC bamm! Below is a example
>
> package com.mycom.myapp.vo
> {
>
> [RemoteClass(alias="myapp.model.security.security")]
>
> [Bindable]
> public dynamic class securityVO implements ValueObject
> {
>
> public var emplid:String = "";
> public var name:String = "";
> public var secgroupid:Number = 0;
> public var secgroup:String = "";
> public var isactive:Boolean = false;
>
>
> public function securityVO()
> {
> }
>
> }
> }
>
>
> <cfcomponent output="false" alias="myapp.model.security.security">
> <!---
> These are properties that are exposed by this CFC object.
> These property definitions are used when calling this CFC as a web
> services,
> passed back to a flash movie, or when generating documentation
>
> NOTE: these cfproperty tags do not set any default property values.
> --->
> <cfproperty name="emplid" type="string" default="">
> <cfproperty name="name" type="string" default="">
> <cfproperty name="secgroupid" type="numeric" default="0">
> <cfproperty name="secgroup" type="string" default="">
> <cfproperty name="isactive" type="boolean" default="0">
>
> <cfscript>
> //Initialize the CFC with the default properties values.
> variables.emplid = "";
> variables.name = '';
> variables.secgroupid = 0;
> variables.secgroup = '';
> variables.isactive = false;
> </cfscript>
>
> <cffunction name="init" output="false" returntype="
> myapp.model.security.security">
> <cfreturn this>
> </cffunction>
>
>
> <cffunction name="getEMPLID" output="false" access="public"
> returntype="any">
> <cfreturn variables.EMPLID>
> </cffunction>
>
> <cffunction name="setEMPLID" output="false" access="public"
> returntype="void">
> <cfargument name="val" required="true">
> <cfset variables.EMPLID = arguments.val>
> </cffunction>
>
> <cffunction name="getName" output="false" access="public"
> returntype="any">
> <cfreturn variables.name>
> </cffunction>
>
> <cffunction name="setName" output="false" access="public"
> returntype="void">
> <cfargument name="val" required="true">
> <cfset variables.name = arguments.val>
> </cffunction>
>
> <cffunction name="getSECGROUPID" output="false" access="public"
> returntype="any">
> <cfreturn variables.SECGROUPID>
> </cffunction>
>
> <cffunction name="setSECGROUPID" output="false" access="public"
> returntype="void">
> <cfargument name="val" required="true">
> <cfif (IsNumeric(arguments.val)) OR (arguments.val EQ "")>
> <cfset variables.SECGROUPID = arguments.val>
> <cfelse>
> <cfthrow message="'#arguments.val#' is not a valid numeric"/>
> </cfif>
> </cffunction>
>
> <cffunction name="getISACTIVE" output="false" access="public"
> returntype="boolean">
> <cfreturn variables.ISACTIVE>
> </cffunction>
>
> <cffunction name="setISACTIVE" output="false" access="public"
> returntype="void">
> <cfargument name="val" required="true">
> <cfif (IsBoolean(arguments.val))>
> <cfset variables.ISACTIVE = arguments.val>
> <cfelse>
> <cfthrow message="'#arguments.val#' is not a valid boolean"/>
> </cfif>
> </cffunction>
>
> <cffunction name="getSECGROUP" output="false" access="public"
> returntype="any">
> <cfreturn variables.DESCR>
> </cffunction>
>
> <cffunction name="setSECGROUP" output="false" access="public"
> returntype="void">
> <cfargument name="val" required="true">
> <cfset variables.DESCR = arguments.val>
> </cffunction>
>
> </cfcomponent>
>
> The above is how the CF-Extension wizards create things.
>
> DK
> On 1/31/07, malik_robinson [EMAIL PROTECTED] wrote:
> >
> > Hi,
> >
> > I am confused on how pass in arguments to the CFC when I am sending
a
> > ValueObject in from Flex. I have this code.
> >
> > *public* *function* saveEmployee( employeeVO : EmployeeVO ): *void*
{
> >
> > *var* call:AsyncToken = service.saveEmployee( employeeVO );
> >
> > call.addResponder( responder );
> >
> > }
> >
> > The parameter employeeVO in the above function contains all the data
the
> > user typed in on my form. I want to pass this data to my CFC as an
> > argument.
> >
> > From there I *think* I can do the rest.
> >
> > How do I do this?
> >
> > -Malik
> >
> >
>
>
>
> --
> Douglas Knudsen
> http://www.cubicleman.com
> this is my signature, like it?
>