3 Replies Latest reply on Mar 1, 2010 7:55 AM by liorchaga

    Navigation Library with Parsley 2.2


      I tried using the new Navigation Library, and I get an exception when using the Waypoint meta tag:




      Error: Unmappable attributes for mapped class com.adobe.cairngorm.navigation.waypoint.decorator::WaypointDecorator: name


      I also tried testing the new library with the insync example, using only the api, shell and expenses modules, and eliminating all use of any cairngorm library other than the navigation and module libraries (which I compiled against parsley 2.2 with no errors).

      I got the same exception.



      What is the new syntax for using waypoint?

        • 1. Re: Navigation Library with Parsley 2.2
          Alex Uhlmann Level 3

          You don't need the name property of the Waypoint metadata anymore, therefore the exception. Just [Waypoint]. Check out the docs here, also because of some other new features in case you've missed them such as deferred and nested navigation.


          We're in the process of migrating to Parsley 2.2. Once that's done, we'll update the Insync samples.

          • 2. Re: Navigation Library with Parsley 2.2
            liorchaga Level 1

            That indeed solved my problem, but still the navigation doesn't work.

            This is my main.mxml:


            <?xml version="1.0" encoding="utf-8"?>
            <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:local="*" xmlns:presentation="com.structures.login.presentation.*"
                                xmlns:presentation1="com.structures.main.presentation.*" xmlns:cairngorm="com.adobe.cairngorm.*"
                 <spicefactory:ContextBuilder config="MainConfig" />
                 <spicefactory:Configure />
                           import com.adobe.cairngorm.CairngormNavigationLib;
                           import com.adobe.cairngorm.navigation.NavigationEvent;
                           import com.structures.main.presentation.MainContentDestination;
                           import mx.rpc.remoting.RemoteObject;
                           import org.spicefactory.parsley.flex.FlexContextBuilder;
                           [Event(name="navigateTo", type="com.adobe.cairngorm.navigation.NavigationEvent")]
                           private function navigateToBO(event:MouseEvent):void
                           private function navigateToLogin(event:MouseEvent):void
                 <cairngorm:CairngormNavigationLib />
                      <mx:Button label="Go to backoffice" click="navigateToBO(event)" />
                      <mx:Button label="Login Page" click="navigateToLogin(event)" />
                      <presentation1:MainViewStack width="100%" height="100%" />



            And this is my view stack:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:ViewStack xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" xmlns:Core="Structures.Core.*"
                             xmlns:spicefactory="http://www.spicefactory.org/parsley" xmlns:presentation="com.structures.login.presentation.*"
                 <spicefactory:Configure />
                           import com.adobe.cairngorm.module.ParsleyModuleDescriptor;
                           import com.adobe.cairngorm.navigation.waypoint.decorator.WaypointDecorator;
                           import com.structures.login.presentation.LoginPM;
                           import mx.modules.IModuleInfo;
                           import org.spicefactory.parsley.flex.FlexContextBuilder;
                           public var backOffice:IModuleInfo;
                 <Core:StructuresViewLoader id="loader" automationName="{MainContentDestination.BACK_OFFICE}" width="100%" height="100%" info="{backOffice}" />
                 <presentation:Login id="login" automationName="{MainContentDestination.LOGIN}" width="100%" height="100%" />


            I thought maybe the messaging is not working because my main.mxml is an application (so he is not configured in the context). But then I tried configure the messaging in a MainPM class injected to main.mxml and dispatch the NavigationEvent through there, and it also didn't work.


            Am I missing something?

            • 3. Re: Navigation Library with Parsley 2.2
              liorchaga Level 1

              I found the problem.

              First, it seems that I was correct about having to go through the MainPM which is configured in the context file.


              And second, the actual problem was that I put the ManagedEvents tag inside the class declaration and not outside of it (not the first time it happens to me).


              Thanks for your help Alex!