Thanks Alex, these information are enlightening. Actually, I meant having access to the module root UI instance (the subclass of s:Module).
Maurice -----Message d'origine----- De : Alex Harui [mailto:[email protected]] Envoyé : mardi 3 septembre 2013 05:53 À : [email protected] Objet : Re: question on modules This is a common misconception: modules do not have a "module instance". All you are doing is loading a factory from which you can make any number of instances of the classes in the module via the factory.create() method. That's why there is no mapping back to a single instance, just the factory. A popup would not be parented by any module instances since they are hung off of the top-level app's systemManager. You'll have to build your own map. -Alex On 9/2/13 5:24 PM, "Maurice Amsellem" <[email protected]> wrote: >Actually, from SamplePopup.mxml, >parentApplication.sampleModuleLoader.child points to the module... > >So if I KNOW that the component is in module X , this is how to get it. > >The problem is that I need a generic mechanism, that would allow me to >get the module instance of any ui component, even if there are several >modules, or even if it belongs to the top level application. > >FYI, the purpose of this is to fix an issue in Cairngorm3/Parsley 2.4 >Popup tag (ie com.adobe.cairngorm.popup.PopupBase class and >subclasses), that does not seem to be module aware. >Actually, PopupBase.getParent() always returns >FlexGlobal.topLevelApplication even if the Popup tag belongs to a >module, instead of the module instance. >The effect of this is that the context is not computed correctly ( >returns the topLevel application context, instead of the module child >context), Which in turn prevent FastInject from working inside Popups >that are declared in modules. > >Regards, > >Maurice > >-----Message d'origine----- >De : Maurice Amsellem [mailto:[email protected]] >Envoyé : mardi 3 septembre 2013 01:56 >À : [email protected] >Objet : RE: question on modules > >I am new to modules, so not sure to understand what you wrote. > >This is how I am using the module: > >In main app: ><s:ModuleLoader id="sampleModuleLoader" url="../SampleModule.swf"/> > >The module itself is declared as follows: > >SampleModule.mxml ><s:Module> > ... ></s:Module> > >Then I have somewhere else a popup defined in the module >SamplePopup.mxml <s:TitleWindow ...> > <s:TextInput id="ti" /> ></s:TitleWindow> > >So what is moduleComponentId in this case ? > >Maurice > >-----Message d'origine----- >De : Mark Kessler [mailto:[email protected]] >Envoyé : mardi 3 septembre 2013 01:21 >À : Users@flex >Objet : Re: question on modules > >Would something like either of the following have any effect on the >your pathing for test purposes? > >(parentApplication.moduleComponentId as >Modulename).ventana.variableName.text = "test"; > >or > >(parentApplication.moduleComponentId as >Object).ventana.variableName.text = "test"; > > >-Mark > >On Mon, Sep 2, 2013 at 6:56 PM, Michael Astudillo < >[email protected]> wrote: > >> Hi, >> When you try to access to a popup trougth a module first you create a >>variable like TitleWindow and second assign the call at this, for >>example: >> >> public var ventana:TitleWindow = new TitleWindow(); function Sample() >> { >> ventana = >> PopUpManager.createPopUp(this,**titleWindowSample,true) >> as TitleWindow; >> PopUpManager.centerPopUp(**ventana); >> } >> >> parentApplication.**moduleComponentId.ventana.**variableName.text = >> ""; >> >>
