Skip to main content
Participating Frequently
December 24, 2010
Question

Cairngorm 3 Navigation library and custom Waypoints

  • December 24, 2010
  • 1 reply
  • 2316 views

Hi all!

How can I set my own  class to process waypoints? I created the class which extends  com.adobe.cairngorm.navigation.waypoint.AbstractWaypoint. And added the following metadata to my ViewStack: [Waypoint(type="path.to.my.Class")].

However when I try to navigate to  this ViewStack's child I receive the following error:

Error: Unable to  set mapped value for [Property type in class  com.adobe.cairngorm.navigation.waypoint.decorator::WaypointDecorator]

What am I doing wrong? How can I use my own classes to process Waypoints and Landmarks?

This topic has been closed for replies.

1 reply

Participating Frequently
December 24, 2010

The error message from Parsley indicates to me that the class type path.to.my.Class in your event metadata could not be resolved. Can you double check if you have spelled it correctly. BTW you could also define a Waypoint externally via i.e. MXML or AS in a Context (using the View object), then the type would not be a magic string.

Participating Frequently
December 24, 2010

I'm pretty sure that my class is correct. MXML definition of the waypoint throws the same error. It works only if I modify the if statement in the WaypointProcessor.preInit() method:

                 if (waypointHandler.waypoint is CurrentStateWaypoint)
            {
                registration = new StateDestinationRegistration(controller.controller,
                                                                waypointHandler,
                                                                name);
            }

              else if (waypointHandler.waypoint is MyWaypointClass) {

                        registration = new ContainerDestinationRegistration(controller.controller,
                                                                    waypointHandler);

                    }
            else
            {
                registration = new ContainerDestinationRegistration(controller.controller,
                                                                    waypointHandler);
            }

Participating Frequently
December 28, 2010

With the below you've forced the compilation of your custom waypoint. To me it still looks like you've just not compiled your custom Waypoint correctly. Note: metadata is just a string to the Flex compiler. If you specify a class path in there, the compiler still doesn't know it. Just try adding the class type of your waypoint anywhere else (i.e. via a private property). Alternativley, using the external configuration via MXML would circumvent this issue. I've just comitted an example to trunk in NavigationParsleyTest>ExternalContext (you'd just use the type property for a custom waypoint).

Additionally, the last commit to trunk contains a few enhancements to the custom waypoint architecture. https://bugs.adobe.com/jira/browse/CGM-46