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.
In one PM I have the following...
public var selectedCustomer:CustomerDetail;
This PM also sets the value of selectedCustomer;
The view for this PM also has a PopUp defined...
And in the PM for the PopUp I have...
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?
Perhaps you forgott to Inject thie context?
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.
Thanks for your response.
I do have
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.
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.
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.
Europe, Middle East and Africa