Thanks, Clark, for your quick response.

I believe that my mappings between my CFCs and AS classes are correct. Here
is the code dump (sorry people):

Calling and receiving getEmployee in the main MXML:

            private function employeeSelected(e:Event):void
            {
                //my_txt.text += "Sending ID: " +
employee_list.selectedItem.id + "\n";
                myService.getEmployee(employee_list.selectedItem.id);

            }

            private function onGetEmployeeResult(re:ResultEvent):void
            {
                var emp:EmployeeVO = re.result as EmployeeVO;
                trace("emp id: " + emp.id);
            }

~~~~~~~~~~~~~~~~~~~~~~

The getEmployee method in the main CFC:

    <cffunction name="getEmployee" access="remote" output="false"
returntype="com.rbx.rbxstaff.vo.EmployeeVO">
        <cfargument name="id" type="GUID" required="true">

        <cfquery name="employee" datasource="rbxstaff">
            SELECT * FROM user
            JOIN person
            JOIN employee
            WHERE user.id = <cfqueryparam value="#arguments.id#"
cfsqltype="cf_sql_varchar">
            AND person.userfk = <cfqueryparam value="#arguments.id#"
cfsqltype="cf_sql_varchar">
            AND employee.userfk = <cfqueryparam value="#arguments.id#"
cfsqltype="cf_sql_varchar">;
        </cfquery>

        <cfscript>
            obj = createObject("component", "com.rbx.rbxstaff.vo.UserVO
").init();
            obj1 = createObject("component", "com.rbx.rbxstaff.vo.PersonVO
").init();
            obj2 = createObject("component", "com.rbx.rbxstaff.vo.EmployeeVO
").init();

            obj2["vacationdaystotal"] = employee.vacationdaystotal;
            obj2["employedfrom"] = CreateDate(2005, 1, 1);
//employee.employedfrom;
            obj2["managerid"] = "managerid"; employee.managerid;
            obj2["email"] = employee.email;
            obj2["phoneext"] = "phoneext";//employee.phoneext;
            obj2["location"] = employee.location;
            obj2["etype"] = employee.type;
            obj2["emergency1name"] = employee.emergency1name;
            obj2["emergency1phone"] = employee.emergency1phone;
            obj2["emergency2name"] = ""; //employee.emergency2name;
            obj2["emergency2phone"] = ""; //employee.emergency2phone;
            obj2["phone1"] = employee.phone1;
            obj2["phone2"] = "";//employee.phone2;
            obj2["mobile"] = "";//employee.mobile;

            obj2["firstname"] = employee.firstname;
            obj2["middlename"] = employee.middlename;
            obj2["lastname"] = employee.lastname;
            obj2["dob"] = employee.dob;

            obj2["id"] = employee.id;
            obj2["name"] = employee.name;

            return obj2;
        </cfscript>

    </cffunction>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The EmployeeVO.cfc:

<cfcomponent extends="com.rbx.rbxstaff.vo.PersonVO" alias="
com.rbx.rbxstaff.vo.EmployeeVO" output="false">

    <cfproperty name="vacationdaystotal" type="numeric" default="10" />
    <cfproperty name="employedfrom" type="date" />
    <cfproperty name="managerid" type="guid" />
    <cfproperty name="email" type="string" />
    <cfproperty name="phoneext" type="string" />
    <cfproperty name="location" type="guid" />
    <cfproperty name="etype" type="guid" />
    <cfproperty name="emergency1name" type="string" />
    <cfproperty name="emergency1phone" type="string" />
    <cfproperty name="emergency2name" type="string" />
    <cfproperty name="emergency2phone" type="string" />
    <cfproperty name="phone1" type="string" />
    <cfproperty name="phone2" type="string" />
    <cfproperty name="mobile" type="string" />

    <cfscript>
        Super.init();

        this.vacationdaystotal = 10;
        this.employedfrom = CreateDate(2005, 1, 1);
        this.managerid = "";
        this.email = "";
        this.phoneext = "";
        this.location = "";
        //this.type = "";
        this.emergency1name = "";
        this.emergency1phone = "";
        this.emergency2name = "";
        this.emergency2phone = "";
        this.phone1 = "";
        this.phone2 = "";
        this.mobile = "";

    </cfscript>

    <cffunction name="init" output="false" returntype="
com.rbx.rbxstaff.vo.EmployeeVO">

        <cfreturn this>
    </cffunction>
</cfcomponent>

~~~~~~~~~~~~~~~~~~~~
The EmployeeVO.as:

package com.rbx.rbxstaff.vo
{
    import com.rbx.rbxstaff.vo.PersonVO;

    [Bindable]
    [RemoteClass(alias="com.rbx.rbxstaff.vo.EmployeeVO")]
    public dynamic class EmployeeVO extends PersonVO
    {
        public var vacationdaystotal:int = 10;
        public var employedfrom:Date;
        public var managerid:String;
        public var email:String;
        public var phoneext:String;
        public var location:String;
        public var etype:String;
        public var emergency1name:String;
        public var emergency1phone:String;
        public var emergency2name:String;
        public var emergency2phone:String;
        public var phone1:String;
        public var phone2:String;
        public var mobile:String;


        public function EmployeeVO() {
        }
    }
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

If anyone can tell anything from this, please pipe in. If I need to add the
other VO files for everyone's, I will do that upon request.

Ugh.

Leif






On Nov 8, 2007 5:32 PM, Clarke Bishop <[EMAIL PROTECTED]> wrote:

>  I have seen something similar to this before. Flex is real picky on the
> mappings between your CFC's and your AS classes.
>
> Once, we fixed it by declaring 'public dynamic class xxx' in AS3 I think.
> Also, make sure your have your RemoteClass alias setup right. Use the Flex
> CFC application wizard if you want to see how this should go.
>
> Hope this helps!
>
>     Clarke
>



-------------------------------------------------------------
To unsubscribe from this list, simply email the list with unsubscribe in the 
subject line

For more info, see http://www.affug.com
Archive @ http://www.mail-archive.com/discussion%40affug.com/
List hosted by http://www.fusionlink.com
-------------------------------------------------------------

Reply via email to