flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurice Amsellem <maurice.amsel...@systar.com>
Subject RE: question on modules
Date Tue, 03 Sep 2013 08:38:02 GMT
 I am using ModuleLoader, and child has a reference to the module UI root instance (as mentioned
in one of numerous emails in this thread).

After reading all your answers and stepping through Parsley and PopupManager again and again
with the debugger, 
I realized there was no reason to pass the Module root view as the "parent" when calling PopupManager.addPopup.
So I reverted to the original Parsley Popup tag implementation, which just returns FlexGlobals.topLevelApplication
as the default parent.
And it's working just fine, even in  modules!
So I don't need anymore to retrieve the module root UI.

Mea culpa.

Thanks again folks!


-----Message d'origine-----
De : Alex Harui [mailto:aharui@adobe.com] 
Envoyé : mardi 3 septembre 2013 08:57
À : users@flex.apache.org
Objet : Re: question on modules

On 9/2/13 11:53 PM, "Maurice Amsellem" <maurice.amsellem@systar.com> wrote:

>Thanks Alex, these information are enlightening.
>Actually,  I meant having access to the module root UI instance (the 
>subclass of s:Module).
If you used ModuleLoader then the child is that thing.  But if you used ModuleManager, you
can create multiple instances of that thing, and that's why the framework doesn't have a back-reference
to "the" module root UI instance since there can be more than one.


>-----Message d'origine-----
>De : Alex Harui [mailto:aharui@adobe.com] Envoyé : mardi 3 septembre 
>2013 05:53 À : users@flex.apache.org 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 
>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.
>On 9/2/13 5:24 PM, "Maurice Amsellem" <maurice.amsellem@systar.com> 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.
>>-----Message d'origine-----
>>De : Maurice Amsellem [mailto:maurice.amsellem@systar.com]
>>Envoyé : mardi 3 septembre 2013 01:56
>>À : users@flex.apache.org
>>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:
>> ...
>>Then I have somewhere else a popup defined in the module 
>>SamplePopup.mxml <s:TitleWindow ...>
>>   <s:TextInput id="ti" />
>>So what is moduleComponentId in this case ?
>>-----Message d'origine-----
>>De : Mark Kessler [mailto:kesslerconsulting@gmail.com]
>>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";
>>(parentApplication.moduleComponentId as 
>>Object).ventana.variableName.text = "test";
>>On Mon, Sep 2, 2013 at 6:56 PM, Michael Astudillo < 
>>mastudillo@austrosoft.com.ec> 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
>>> public var ventana:TitleWindow = new TitleWindow(); function 
>>> Sample() {
>>>                ventana =
>>> PopUpManager.createPopUp(this,**titleWindowSample,true)
>>> as TitleWindow;
>>>                 PopUpManager.centerPopUp(**ventana);
>>> }
>>> parentApplication.**moduleComponentId.ventana.**variableName.text = 
>>> "";

View raw message