0 Replies Latest reply on Apr 1, 2011 8:04 AM by Joan Llenas

    Runtime ParsleyModuleManager for message interception

    Joan Llenas

      Hi,

      ( using Flex 4.1, Cairngorm 3 Module library and Parsley 2.3 )

      I'm trying to send a message to a ModuleViewLoader instance before it has been completely loaded.

      I am doing it using with a ModuleMessageInterceptor that wraps a Message type annotated with [ModuleID] (because I want to send messages to instances).

      I think I get the theory but I'm unable to achieve my goal.

       

      Something that may be problematic is the fact that I am creating the ParsleyModuleManager instances at runtime, not with the ParsleyModuleDescriptor tag.

      An example:

       

      var menuModuleManager:ParsleyModuleManager = new ParsleyModuleManager(

                          menuDescriptor.url,

                          context, 

                          ClassInfo.currentDomain,

                          null, null

      );

      var menuLoader:ModuleViewLoader = new ModuleViewLoader();

      menuLoader.moduleId = menuDescriptor.menuUID;

      container.addElement(menuLoader);

      menuLoader.loadModule(menuModuleManager);

      dispatcher(new SetMenuDescriptorMessage(menuDescriptor.menuUID, menuDescriptor));

       

      I have also tried to mimmic the ParsleyModuleDescriptor tag logic in order to add the menuModuleManager instance to the context but it didn't work either.

      I appreciate any help on this.

       

      cheers!