Popups in Flex Using PureMVC
I have recently developed a Flex upload component using PureMVC. The component is based on a TitleWindow and displayed as a popup window. I hit a small obstacle involving Mediator registration which was due to the upload component instance not being created until I call the createPopUp() method from the PopUpManager class. The solution (thanks Cliff) came from this helpful post in the PureMVC forum (thanks daniele) and here is some of the code snippets from my application that got things running:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
I have a CanvasStage.mxml component which holds a button which when clicked dispatches an Event to its mediator and opens the popup window.
1 2 3 4
The upload component is UploadForm.mxml with the TitleWindow default close button dispatching an Event to the UploadEventMediator calling the below method.
1 2 3 4 5 6