Exactly, that's what the Popup wrapper is all about.
It implements IMXMLObject, so it knows the document where it is defined and
uses that information to retrieve the context (since, as you say, the popup
itself is not added to the the context).
In the example below, Popup will use CallerClass to retrieve the context.
The issue was when CallerClass was itself opened as a popup (that is, a popup
opened from within another popup).
<CallerClass>
<parsley:Popup open="{someBindableFlag}">
<MyTitleWindow/>
</parsley:Popup>
It's like magic and make it really simple to use.
Maurice
-----Message d'origine-----
De : Frédéric THOMAS [mailto:[email protected]]
Envoyé : mardi 3 septembre 2013 13:22
À : [email protected]
Objet : RE: question on modules
Usually, Parsley:PopUp can only detect the context of a Class if this one has
been added to a context, generally its module context in case it stands in a
module, when you use fast inject instead of configure, the class is not added
to the context, so Parsley:PopUp should return its closer above context, am I
wrong ?
-Fred
-----Message d'origine-----
De : Maurice Amsellem [mailto:[email protected]]
Envoyé : mardi 3 septembre 2013 12:18
À : [email protected]
Objet : RE: question on modules
That's what parsley Popup tag is supposed to do for me (call
context.viewManager.addViewRoot and addPopup).
Anyway, I reverted to the original implementation of parsley Popup, and popup
injections are now working fine, even in modules.
Thanks again for the help.
Maurice
-----Message d'origine-----
De : Frédéric THOMAS [mailto:[email protected]] Envoyé : mardi 3
septembre 2013 02:49 À : [email protected] Objet : RE: question on modules
Not sure I understood what you want at the end but if you want to open a popup
contains in a module, either you know the popup class and call it via a static
show function and inside the show function, you add "
context.viewManager.addViewRoot(yourPopupInstance);" before calling "
PopUpManager.addPopUp" or you don't know the popup class and you can create an
event/command in the module that call it in the same way I described before.
-Fred
-----Message d'origine-----
De : Maurice Amsellem [mailto:[email protected]]
Envoyé : mardi 3 septembre 2013 02:24
À : [email protected]
Objet : RE: question on modules
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 =
> "";
>
>