tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/282-extending-mediatorsRobotlegs: Discussion 2018-10-18T16:35:17Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/29875392010-09-16T15:34:42Z2010-09-16T15:34:42ZExtending Mediators<div><p>Hello Jono,</p>
<p>The short answer is: yes!</p>
<p>In the current version of Robotlegs you need to use the third parameter (injectViewAs) of mediatorMap.mapView(). For example:</p>
<pre>
mediatorMap.mapView(ViewB, MediatorB, ViewA);
mediatorMap.mapView(ViewC, MediatorC, ViewA);
</pre>
<p>In MediatorA you'd create a view dependency that looks like this:</p>
<pre>
[Inject]
public var viewA:ViewA;
</pre>
<p>In MediatorB you'd cast that to ViewB:</p>
<pre>
public function get viewB():ViewB
{
return viewA as ViewB;
}
</pre>
<p>And likewise with MediatorC.</p>
<p>It's a bit of a pain, but will be made easier in a future version.</p>
<p>Hope that helps!</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/29875392010-09-17T00:01:19Z2010-09-17T00:01:20ZExtending Mediators<div><p>Hi Shaun,</p>
<p>Help it did!</p>
<p>Worked a treat, gotta say the fast responses on this forum make it a pleasure to know there is great support for RL.</p>
<p>Thanks,<br />
Jono</p></div>Jono