Title: Fabrication, Modules and Popups oh my... Post by: grimmwerks on March 10, 2011, 11:11:36 I've got an app that uses Fabrication and loads in a few modules using the FlexModuleLoader...
I've a two part question: 1) how best to control regular alerts / popups from one of the modules so that it displays at the top most level (ie through notification to the main application via message body) 2) how to take a module that is loaded in and display that as a popup -- again probably partially through #1 but unsure how to make a module display as part of PopupManager? I've read Simon's / newtriks posts both here and on his own site and I don't think it's going to work the same way I need to work... Greatly appreciate any assistance as I'm not sure how best to deal with multi modules as popups... Title: Re: Fabrication, Modules and Popups oh my... Post by: grimmwerks on March 10, 2011, 11:32:33 Ok #1 is easier than I thought.
In my constants file I just have a new message of ALERT_SIMPLE (thinking I couldn't do the closehandler at first). The main app mediator responds as such: public function respondToAlertSimple(note:INotification):void{ var n:Object = note.getBody(); mx.controls.Alert.show(n.text, n.title, n.flags, this.application, n.closeHandler, n.iconClass, n.defaultButtonFlag); } That way any module can just send the notification public function reactToButtonCancelDay$Click(ev:Event):void{ //routeNotification(MixConstants.ORDER_CANCEL_DAY, null, null, "*"); routeNotification(MixConstants.ALERT_SIMPLE, {text: "test", title:"first", closeHandler: this.returnAlert}); } public function returnAlert(ev:Event):void{ routeNotification(MixConstants.ALERT_SIMPLE, {text: "YEH got it", title:"response" }); } But more importantly I need to know how to pop open a module.... |