|
Not really necessary
On your delegate you can attached the userID to the call
object and then access through your command.onResult param.token
object
public class LoginCommand implements Command,
Responder
{ public function execute(event:CairngormEvent):void { var delegate:LoginDelegate = new LoginDelegate(this); var loginEvt:LoginEvent = LoginEvent( event ); delegate.login(loginEvt.userVO); } public function onResult(event:*=null):void { var submitVO:UserVO = UserVO(event.token.user); } public class
LoginDelegate
{ public function LoginDelegate(responder:Responder) { service = ServiceLocator.getInstance().getService('userGateway'); this.responder = responder; } public function login(user:UserVO):void { var call:AsyncToken = service.validate(user); call.user = user; call.resultHandler = responder.onResult; call.faultHandler = responder.onFault; } private var service:AbstractService; private var responder:Responder } Regards,
Bjorn
Schultheiss
Senior Flash
Developer
QDC
Technologies
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Robin Burrer Sent: Wednesday, 11 October 2006 11:12 AM To: [email protected] Subject: [flexcoders] Cairngorm commands - best practise
Hi
there Let’s say I want to do
a server request. I want to search my database for a particular keyword and
return a record set. The user would type in
the keyword in a text area and I would then create a SearchDatabaseEvent which
then would trigger a SearchDatabaseEvent However I also want to
send the userID when I do my server request. Should the
SearchDatabaseComma This approach seems a
bit wired though because it seems that couples my command to strongly to the
model. On the other hand it seems strange to query the model from my view to
populate the SearchDatabaseEvent with userId property as well.
Any
thoughts? Cheers
Robin -- 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
Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required) Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe __,_._,___ |
- [flexcoders] Cairngorm commands - best practise Robin Burrer
- Re: [flexcoders] Cairngorm commands - best practise hank williams
- [flexcoders] Cairngorm commands - best practise Bjorn Schultheiss
- Re: [flexcoders] Cairngorm commands - best prac... hank williams
- [flexcoders] Cairngorm commands - best prac... Bjorn Schultheiss
- Re: [flexcoders] Cairngorm commands - best practise Tom Chiverton
- Re: [flexcoders] Cairngorm commands - best prac... hank williams
- Re: [flexcoders] Cairngorm commands - best ... Ralf Bokelberg
- RE: [flexcoders] Cairngorm commands - best practise Robin Burrer
- RE: [flexcoders] Cairngorm commands - best practise Evan Gifford

