Property resut

 

Typo here: event.resut.UserInfo.BrokerID

 

resut à result   

 

 


From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of flycl65
Sent: Thursday, August 03, 2006 1:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Newbie Help - simple login via CFC

 

Trying to do a simple login via CFC. Query SQL db and return a field
value (BrokerID).

Returning the following error:
ReferenceError: Error #1069: Property resut not found on
mx.rpc.events.ResultEvent and there is no default value.

I tried doing it by returning the query and couldn't get it to work,
and now tried a structure. Help. ??????????

<cffunction name="login" access="remote">
<!-- make sure we have username and password -->
<cfargument name="username" required="true" type="string" />
<cfargument name="password" required="true" type="string" />
<cfquery name="getUser" datasource="dentalsales">
SELECT *
FROM Users
WHERE Logon = '#arguments.username#'
AND password = '#arguments.password#'
</cfquery>

<!-- if username and password are correct -->
<cfif getUser.recordCount eq 1>
<cfset userInfo = structNew()>
<cfset userInfo.isLoggedIn = "true">
<cfset userInfo.username = getUser.logon>
<cfset userInfo.BrokerID = getUser.BrokerID>
<cfreturn userInfo />
</cfif>

----------------------------------------------------------

private function login_result(event: Object):void
{


// login successful, remember the user.
if( (event.result) )
{
// assign BrokerID
this.BrokerID = event.resut.UserInfo.BrokerID;
trace(BrokerID);

if( this.rememberLogin.selected )
{
this.lso.data['username'] = this.username.text;
this.lso.data['password'] = this.password.text;
}
else
{
this.lso.data['username'] = null;
this.lso.data['password'] = null;
}

this.dispatchEvent( new Event('loginSuccessful') );
}
else
{
// login didn't work. show message
errorMessage("Login unsuccessful");
}
}

</cffunction>

__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to