NavigationParsley
I have been trying to understand a basic example of Navigation with parsley, I am using parsley 2.3.1 and navigation and navigationParsley 1.1
I have declared the context, created a ViewStack with to views inside with their views inside like this:
<mx:ViewStack xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:presentation="org.mxhero.console.frontend.presentation.*" xmlns:spicefactory="http://www.spicefactory.org/parsley"> <fx:Script> <![CDATA[ import org.mxhero.console.frontend.application.MainDestinations; [Injected] [Bindable] public var model:MainViewPM; ]]> </fx:Script> <fx:Declarations> <spicefactory:Configure/> </fx:Declarations> <fx:Metadata> [WayPoint] </fx:Metadata> <s:NavigatorContent width="100%" height="100%" automationName="{MainDestinations.LOGIN}" > <s:layout> <s:VerticalLayout horizontalAlign="center" verticalAlign="middle" /> </s:layout> <presentation:Login /> </s:NavigatorContent> <s:NavigatorContent width="100%" height="100%" automationName="{MainDestinations.DASHBOARD}"> <s:layout> <s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/> </s:layout> <presentation:Dashboard/> </s:NavigatorContent> </mx:ViewStack>
Here is the model:
package org.mxhero.console.frontend.presentation { import com.adobe.cairngorm.navigation.NavigationEvent; import org.mxhero.console.frontend.application.MainDestinations; public class MainViewPM { [MessageDispatcher] public var dispatcher:Function public function navigateTo(destination:String):void { dispatcher(NavigationEvent.createNavigateToEvent(destination)); } } }
Here is one model from the views in the ViewStack
package org.mxhero.console.frontend.presentation { import mx.controls.Alert; import org.spicefactory.parsley.core.messaging.MessageProcessor; [Landmark(name="content.dashboard")] public class DashboardPM { [Enter(time="first")] public function firstEnter():void { Alert.show("First"); } [Enter(time="next")] public function enter():void { Alert.show("Next"); } [Exit] public function exit():void { Alert.show("Exit"); } [EnterInterceptor] public function enterInterceptor(processor:MessageProcessor):void{ processor.proceed(); Alert.show("Proceed"); } } }
and here is that view:
<?xml version="1.0" encoding="utf-8"?> <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="400" height="300" xmlns:dashboard="org.mxhero.console.frontend.presentation.dashboard.*"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> <s:layout> <s:VerticalLayout/> </s:layout> <fx:Script> <![CDATA[ [Injected] [Bindable] public var model:DashboardPM; ]]> </fx:Script> <dashboard:Header/> <dashboard:BodyView/> </s:Group>
When i try to cal navigateTo, i see in the debug console that the views are called but the viewStack does not change. I am kinda lost, i have searched all the examples in the repository for the navigation Library and i am not seeing what is wrong, any one can give me a hand with this?
Thanks!
