How to Create Popup Using Cairngorm PopUpWrapper in Flex

If you are using parseley or caingorm framework for your flex application then you may probably face Dependency Injection problem in popup panel.I feel code relationship disconnected if you use popup in Cairngorm framework.And Special handling required if you use popup in Cairngorm framework.

I faced this problem in my flex application  and I used Cairngorm PopUpWrapper to solve this problem.

How to Use Cairngorm PopUpWrapper

Step1: Download the popupParsley-1.10.swc,popup-1.10.swc

Step2:Copy and Paste in Build Path.

Step3:

Declare the context

Inject

[Bindable]

public var context:Context;

         Add the below code in <fx:Declaration> section

	<fx:Declarations>
	<spicefactory:Configure/>
	<cairngorm:PopUpWrapper open="{}" id="popup" >
	<pres:NMSChangePasswordPanel popUpWrap="{popup}" 
 id="popUpId" />
	<cairngorm:behaviors>
	<cairngorm:AddPopUpToParsleyContext 
context="{context}"/>
	</cairngorm:behaviors>
	</cairngorm:PopUpWrapper>
</fx:Declarations>

Step4:
        Add the following line if you want to open popup window
 popup.open = true;
Step5:
  Add the following line if you want to close popup window
popup.open = false;
  • devang

    I’m facing similar problem in one of my project. In my case the ‘context’ is not getting injected (null value). Is the context of type ‘org.spicefactory.parsley.core.context.Context’? Also the view in the popup has a presentation model, which is also not getting injected (null value). Any help here is much appreciated.