Spicefactory Forum Index Spicefactory
Forum Archive
 
 SearchSearch    Log inLog in 

Flex Mobile views and navigation

 
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory
View previous topic :: View next topic  
Author Message
-=Deus=-



Joined: 27 Apr 2011
Posts: 7

PostPosted: Tue Apr 10, 2012 1:42 pm    Post subject: Flex Mobile views and navigation Reply with quote

Hello,
I'm currently developing mobile Flex application using Parsley framework and have some troubles with navigation between views.
Here is the short example.
1. My sample view is:
Code:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" ...>
    <fx:Declarations>
        <parsley:FastInject property="model" type="{AuthorizationPM}" />
    </fx:Declarations>
   
    <fx:Script>
        <![CDATA[
         
            [Bindable]
            public var model:AuthorizationPM;
        ]]>
    </fx:Script>
    <!-- Other components -->
    <s:Button label="Enter" click="this.model.authenticate(usernameInput.text, passwordInput.text)" />
</s:View>


2. The corresponding presentation model (all configuration is defined in separate MXML config, so there are no Metadata tags):
Code:

package presentation {
   import domain.AuthenticationModel;
   
   public class AuthorizationPM {
      
      public var dispatcher:Function;
      
      [Bindable]
      public var isAuthenticating:Boolean;
      
      [Bindable]
      public var authenticationModel:AuthenticationModel;
      
      public function authenticate(username:String, password:String):void {
         this.dispatcher(new AuthenticateMessage(username, password));
      }

      public function authenticateComplete():void {
         /* This code runs after authentication command has finished execution. At this moment I need to detect if the user was authenticated successfully and navigate to the next view. But the navigation logic is handled by the view itself and not by presentation model. */
      }
   }
}


So, my question is the following. Is there any best practice to notify the view about the completion of the authentication command, so I could push the next view to the view navigator?

Thanks in advance.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Spicefactory Forum Index -> Spicefactory All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group