Copy link to clipboard
Copied
Hello,
I am having difficulty accessing a shared object form a PopUp that is part of a module.
In my module I have the following defined in my module's context.
<domain:CustomerDetail/>
In one PM I have the following...
[Inject]
[Bindable]
public var selectedCustomer:CustomerDetail;
This PM also sets the value of selectedCustomer;
The view for this PM also has a PopUp defined...
<popup:PopUpWrapper open="{model.showCustomerDetailsDialog}"
opened="model.initDetailsPopup(event)"
closed="model.handlePopUpClosed(event)"
parent="{this}"
center="true" modal="true">
<presentation:DetailsDialog/>
<popup:behaviors>
<popup:AddPopUpToParsleyContext context="{context}"/>
</popup:behaviors>
</popup:PopUpWrapper>
And in the PM for the PopUp I have...
[Inject]
[Bindable]
public var customer:CustomerDetail;
When I look at this customer object in PopUp PM it is always null. Another object that is defined in the parent shell applicaiton's context however is not null. Th eonly way i can seem to set the customer object in the PopUp PM is to explicitly set it during the opening event in the PM that launches the PopUp.
Has anyone seen this behaviour? Does anyone have a sample of using Popups with Cairngorm + Parsley and modules?
Copy link to clipboard
Copied
Perhaps you forgott to Inject thie context?
[Inect]
[Bindable]
public var context::Context; //don't no the full classname, just use your AutoComplete to import it.
How do you know that "public var selectedCustomer:CustomerDetail" isn't null? You also have to call the "ConfigureView" (parlsey 2.3) or "ConfigureIoc" Event on the component addedToStage event. If not called, the context won't be inected either.
I've made it to work and i can provide you an example later this day.
Copy link to clipboard
Copied
Thanks for your response.
I do have
[Inject]
[Bindable]
public var context::Context;
in the MXML where PopupWrapper is being used.
My issue seems to involve the use of modules. I can use popups fine in my root application. Any popups that appear in a module however are only able to access objects from the root context and not the child context it is in. I've actually tried showing popups without PopupWrapper using the process described in the Parsley docs and get the same result. This leads me to believe the issue is not with PopupWrapper but with Parsley instead.
Has anyone been able to successfully wire up a popup from a module using Cairngorm 3 and Parsley 2.2? I'd love to see an example if you have.
Copy link to clipboard
Copied
Sry, haven't seen that you was talking about modules.
Why don't you post the full source of the mxml file on the parsley forum . The developer of parsley is always answering the threads.
Actually i can't see any reason, why not to pass the reference to the popup directly. Sure it's not so cool like an iject tag, but it would be also a dependecy injection. A setter injection if being precize.
Copy link to clipboard
Copied
why do you have a double colon?
public var context::Context;
Copy link to clipboard
Copied
True, that double colon was probably a typo. BTW, this is an old post. With newer Parsley versions you'd probably want to use Parsley's PopUp tag, which doesn't need any Context/view wiring usage. It uses the C3 popup lib beind the scences.
Copy link to clipboard
Copied
really nice is this out yet, also are there plans to get signals as messages, I hate buggy event strings
Copy link to clipboard
Copied
No plans, but please feel free to add a patch via the JIRA bugbase.