hi i have a datagrid that i want to populate here is the code.

<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; width="100%" height="100%" 
backgroundColor="#400000" creationComplete="remoteObj.userData.send()">
        <mx:Script>
                <![CDATA[
                        import mx.collections.ArrayCollection;
                import mx.rpc.events.ResultEvent;
            import mx.rpc.events.FaultEvent;
            import mx.utils.ObjectUtil;
            import mx.controls.Alert;
            
            [Bindable]
                        private var dataAr:ArrayCollection;
                        private function 
concernOriginalReceived(event:ResultEvent):void {
                                dataAr = event.result as ArrayCollection;
                                
//trace(ObjectUtil.toString(event.result.source[0].firstname));
                                //trace(dataAr);
                        }
                ]]>
        </mx:Script>
        
        <mx:RemoteObject id="remoteObj" destination="ColdFusion" 
source="example3.cfc.log">
                <mx:method name="userData" 
result="concernOriginalReceived(event)" 
fault="Alert.show(event.fault.faultString,'Error');"/>
        </mx:RemoteObject>

    <mx:Form x="0" y="0">
        <mx:FormItem label="User Name:">
            <mx:TextInput id="username" text="stinasius"/>
        </mx:FormItem>
        <mx:FormItem label="Password:">
            <mx:TextInput id="password" text="delfzil"/>
        </mx:FormItem>
        <mx:FormItem label="First Name:">
            <mx:TextInput id="firstname"/>
        </mx:FormItem>
        <mx:FormItem label="Last Name:">
            <mx:TextInput id="lastname"/>
        </mx:FormItem>
        <mx:FormItem label="Email:">
            <mx:TextInput id="email"/>
        </mx:FormItem>
    </mx:Form>
    <mx:DataGrid x="285" y="0" dataProvider="{dataAr}"/>        
</mx:Canvas>

"log.cfc"

<cffunction name="userData" access="remote" returntype="query">
                        <cfargument name="username" type="string" 
required="yes"/>
                    <cfargument name="password" type="string" required="yes"/>

                    <cfquery name="storeuserData" datasource="authentication">
                          SELECT *
                          FROM profile
                                where username = <cfqueryparam 
cfsqltype="cf_sql_varchar" value="#arguments.username#">
                                and Password = <cfqueryparam 
cfsqltype="cf_sql_varchar" value="#arguments.password#">
                    </cfquery>
                                                
                        <cfreturn storeuserData>
           </cffunction>

i get this error msg "Unable to invoke CFC - The USERNAME parameter to the 
userData function is required but was not passed in." help would be 
appreciated. thanks


Reply via email to