tag:robotlegs.tenderapp.com,2009-10-18:/discussions/robotlegs-2/2657-module-doesnt-get-any-events-when-moved-to-another-containerRobotlegs: Discussion 2014-02-04T16:13:24Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/270358712013-05-28T11:14:59Z2014-02-04T16:13:21ZModule doesn't get any events, when moved to another container.<div><p>Ok, problem is that module's mediator destroys, when i change
view's container, and new one doesn't create. Is there any way to
avoid it?</p></div>ishaban.flashtag:robotlegs.tenderapp.com,2009-10-18:Comment/270358712013-05-28T11:17:15Z2014-02-04T16:13:24ZModule doesn't get any events, when moved to another container.<div><p>Hey Ivan,</p>
<p>I dont know how to send you PM,<br>
can you contanct me on matej(at)gv3.me</p></div>matejtag:robotlegs.tenderapp.com,2009-10-18:Comment/270358712013-05-28T13:01:53Z2014-02-04T16:13:22ZModule doesn't get any events, when moved to another container.<div><p>Solution founded, i'm just inject main contentView in modules,
and them use it as own. So now, code looks like:</p>
<pre>
<code> private function loadCompleteHandler (event:BulkProgressEvent):void {
var loader:BulkLoader = BulkLoader.getLoader("modules");
loader.removeEventListener(BulkProgressEvent.COMPLETE, loadCompleteHandler);
for each (var link:String in model.modules) {
var content:IModule = loader.getContent(link) as IModule;
content.setup(dispatcher, contextView);
}
dispatcher.dispatchEvent(new ModuleEvent(ModuleEvent.INITIALIZE));
context.release(this);
}</code>
</pre>
<p>And in module:</p>
<pre>
<code> public function setup (dispatcher:IEventDispatcher, contextView:ContextView):void {
_context = new Context()
.install(ModuleBundle)
.configure(BottomBarConfig)
.configure(new EventDispatcherExtension(dispatcher))
.configure(contextView);
}</code>
</pre></div>ishaban.flashtag:robotlegs.tenderapp.com,2009-10-18:Comment/270358712013-05-28T17:41:04Z2013-05-28T17:41:04ZModule doesn't get any events, when moved to another container.<div><p>Do you have logging enabled? Perhaps it can provide some clues
as to what is going on under the hood?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/270358712013-05-28T17:42:39Z2013-05-28T17:42:39ZModule doesn't get any events, when moved to another container.<div><p>Ah, whoops, sorry your replies got marked as spam for some
reason. I've restored them.</p></div>Shaun Smith