tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/8-multiple-views-controlled-by-one-mediatorRobotlegs: Discussion 2012-07-20T12:23:49Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-11-05T14:29:49Z2012-07-20T15:43:21ZMultiple views controlled by one Mediator<div><p>An internal ticket was created for this discussion</p></div>Systemtag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-11-05T14:41:26Z2009-11-05T14:41:26ZMultiple views controlled by one Mediator<div><p>Perhaps using setter injection might be a better route. Then you
could override the setter and [Inject(name="whatever")] on the
method setting the protected value.</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-11-05T14:57:13Z2009-11-05T14:57:35ZMultiple views controlled by one Mediator<div><p>If your KeyedImageStripMediator depends on ImageStrip, you can
pass it into injectViewAs when calling mapView(), like so:</p>
<p><code>mapView(KeyedImageStrip, ImageStripMediator,
ImageStrip);</code></p>
<p>This will create an ImageStripMediator when a KeyedImageStrip
lands on stage, but it will inject the KeyedImageStrip as an
ImageStrip (which is what your Mediator actually depends on).</p>
<p>Does that help at all?</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-11-05T15:29:11Z2009-11-05T15:29:14ZMultiple views controlled by one Mediator<div><p>I temporarily sidestepped the issue by duplicating the code from
<code>ImageStripMediator</code> in the two new mediators. It was
just a line or two, still, not very pretty. Sadly, with the way my
current deadline is looming it'll have to stay that way until I've
got some more tinkering time.</p>
<p>But I think this could be solved with either method, Joels is
more tailored to my specific need but i think Shauns is a bit less
magical ;)</p></div>grapefrukttag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-12-07T14:28:13Z2009-12-07T14:28:13ZMultiple views controlled by one Mediator<div><p>Hi Grapefrukt,</p>
<p>I believe that:</p>
<p><code>mapView(KeyedImageStrip, ImageStripMediator,
ImageStrip);</code></p>
<p>would be the best solution to this problem. I'm going to close
this issue for now, but please feel free to re-open it if you feel
the answer to be dis-satisfactory.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/5425592009-12-11T20:55:04Z2009-12-11T20:55:04ZMultiple views controlled by one Mediator<div><p>Actually, I think I misunderstood the core issue here. See
response to:</p>
<p><a href=
"http://knowledge.robotlegs.org/discussions/questions/21-subclassing-mediators">
http://knowledge.robotlegs.org/discussions/questions/21-subclassing...</a></p></div>Shaun Smith