tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/8073-get-reference-to-mediatormapRobotlegs: Discussion 2014-04-30T08:24:24Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/326820722014-04-24T08:30:30Z2014-04-24T08:30:30Zget reference to mediatorMap<div><p>Hello,</p>
<p>I don't think that is a good idea to use
mediatorMap.registerMediator.<br>
See this discussion:<br>
<a href=
"http://knowledge.robotlegs.org/discussions/problems/3743-map-a-movieclip-instance-to-a-mediator#comment_28619942">
http://knowledge.robotlegs.org/discussions/problems/3743-map-a-movi...</a></p>
<pre>
<code>mediatorMap.registerMediator(view, this);</code>
</pre>
<p>"this" doesn't make much sense in your mapping, because the
second parameter is expected to be an IMediator</p>
<blockquote>
<p>It looks like the mediatorMap is only available within an
instance of Context or Mediator class.</p>
</blockquote>
<p>The mediatorMap is also available in Commands. Or, you can let
the injector get an instance of the mediatorMap.</p>
<blockquote>
<p>The automatic mediation does not seem to work.</p>
</blockquote>
<p>It seems like there are some issues with your contextView and
the way you create the context.<br>
First thing to check is whether you have a context at all!<br>
You said that your app worked just fine as a standalone project.
How are you instantiating the context when you integrate it into
the other project? What are you using as a contextView? Are your
views added to your contextView (put a trace statement inside your
added to stage handlers to see their parent)?</p>
<p>Ondina</p></div>Ondina D.F.tag:robotlegs.tenderapp.com,2009-10-18:Comment/326820722014-04-28T18:44:38Z2014-04-28T18:44:38Zget reference to mediatorMap<div><p>Thanks for the quick response. I realized that I was
initializing the context in a non-UI class. Once I moved it to a
UI-component, everything started working.</p></div>virattag:robotlegs.tenderapp.com,2009-10-18:Comment/326820722014-04-30T08:23:27Z2014-04-30T08:23:27Zget reference to mediatorMap<div><p>No problem! Glad you found the culprit ;)</p></div>Ondina D.F.