tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/296-module-mapview-not-firingRobotlegs: Discussion 2013-04-28T09:55:57Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-04-12T11:28:43Z2011-04-12T11:30:40ZModule mapView not firing<div><p>Do you call super.startup in MyDisplayModuleContext.startup
before mapping MyComponent to MyComponentMediator?<br>
Because it will send out a ContextEvent.STARTUP_COMPLETE event,
which in this case means the component gets added to the display
list before it's mapped to its mediator.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-04-12T11:58:47Z2011-04-12T11:58:47ZModule mapView not firing<div><p>Hi @creynders, this the order of events (I just verified
debugging to make sure):</p>
<ul>
<li>Module created ></li>
<li>ModuleContext::startup() ></li>
<li>TemplateDisplayModuleContext::startup() ></li>
<li>MyComponent to MyComponentMediator mapped ></li>
<li>TemplateDisplayModuleContext::super.startup() ></li>
<li>new instance of MyDisplay() created ></li>
<li>new instance of MyDisplay() gets added to the stage.</li>
</ul></div>simontag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-04-12T12:56:02Z2011-04-12T12:57:01ZModule mapView not firing<div><p>Looking at your code snippets again I think maybe the display
list the view gets added to is not the display list that the
modulecontext is listening to for the ADDED_TO_STAGE events.<br>
In MyDisplayModule<br></p>
<pre>
<code>context=new MyDisplayModuleContext(this);</code>
</pre>
<p>you pass 'this' to the context, which means it will listen to
the displaylist of MyDisplayModule, but the component is added to
the viewContainer with<br></p>
<pre>
<code>viewContainer.addElement(nextModule.view);</code>
</pre>
<p>My guess is that's where it goes wrong?<br>
That it gets added "above" MyDisplayModule instead of inside.</p></div>creynderstag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-04-12T13:08:41Z2011-04-12T13:09:29ZModule mapView not firing<div><p>My doubts lay in the same area, fresh eyes are always mega
helpful mate thanks, I will look deeper. What I was trying to avoid
was having to start editing ModuleContextView further for this.</p></div>simontag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-04-21T00:24:28Z2011-04-21T00:24:29ZModule mapView not firing<div><p>You may also want to think about whether your contexts that get
created in Step 3 get garbage collected before they are used.</p></div>Amy Blankenshiptag:robotlegs.tenderapp.com,2009-10-18:Comment/65859372011-05-02T15:35:33Z2011-05-02T15:35:33ZModule mapView not firing<div><p>Closing this as I know you've now fixed it. Feel free to reopen
it if you need more follow-up.</p>
<p>Stray</p></div>Stray