Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Problem upgrading from M2 to RC1

  1. #11
    Join Date
    Mar 2009
    Posts
    8

    Default M2 -> RC1 migration : login result handler

    thanks for the hint to migrate to RC1:

    Another hint for people migrating from M2 to RC1, you may have to change your flex code that handle the login result event.

    I was using the following code

    Code:
    	// Handle successful login. 
    		private function LoginResultEvent(event:ResultEvent, token:Object=null):void
    		{
    			
    			switch (event.result)
    			{
    				case "success":
    					Alert.show("Login OK: ");
    					dispatcher.dispatchEvent(new LoginEvent(LoginEvent.LOGIN_SUCCESSFUL));
    					break;
    				default:
    			}
    		}
    which does not work anymore in RC1 since user details are now returned by the server upon login
    Extracted from reference documentation here is a code that works

    Code:
    var token:AsyncToken = myChannelSet.login("jeremy","atlanta");
    token.addResponder(
    	new AsyncResponder(
      		function(event:ResultEvent, token:Object = null):void {
      			if (event.result.authorities.indexOf("ROLE_ADMIN") >= 0) {
      				displayAdminPanel(event.result.name);
      			} else {
      				displayUserPanel(event.result.name);
      			}
      		},
      		function(event:FaultEvent, token:Object = null):void {
      			displayErrorMessage("Login Failed: "+event.fault.faultString);
      		}
      	)
    );


    BTW Thanks for the RC1, I can't wait testing the messaging feature!

    Pierre

  2. #12
    Join Date
    Sep 2008
    Posts
    2

    Default

    You should also add it to the documentation section "What Spring BlazeDS Integration requires to run". It would have helped me a bit :-P

  3. #13
    Join Date
    Dec 2009
    Posts
    3

    Default please help me to take first step in the enterprise world

    Hi everybody

    I am a flex developer and struggling with my first flex spring integration example. I went through many links including the one suggested in this discussion but nothing seems giving me a solution. i am using spring-flex-1.0.1.RELEASE, is this problem related to the this spring-blazeDS integartion release ? In most of the examples they have been using Maven which i doesnt know about it.

    Could anybody in this forum give me an insight about how to get out of this error ?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •