tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/479-what-does-setviewcomponent-actually-doRobotlegs: Discussion 2018-10-18T16:35:24Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/60004142011-03-16T15:42:52Z2011-03-16T15:42:52ZWhat does setViewComponent() actually do<div><p>Hi Stephen,</p>
<p>it just provides an untyped reference that the mediatorMap can
then use to retrieve the view to do the unmapping - check out the
code around line 180 here:</p>
<p><a href=
"https://github.com/robotlegs/robotlegs-framework/blob/master/src/org/robotlegs/base/MediatorMap.as">
https://github.com/robotlegs/robotlegs-framework/blob/master/src/or...</a></p>
<p>Basically the mediatorMap has a number of dictionaries, for
mediator-by-view etc etc, and this reference allows it to get the
view object so that it can look stuff up.</p>
<p>It's really just a simple property storage - set/getViewObject,
which then allows you to name your view property in your mediator
anything you like.</p>
<p>So - if you wanted to, you could expose that property in your
mediators, and then it would allow you to always use the same
property if you wanted to interogate them to find the view they
pair with. It's just typed as Object, so you would need to cast it
to DisplayObject or whatever if you needed to use it in the context
of the display list.</p>
<p>I hope that's helpful - let us know if you need more info,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/60004142011-03-16T15:58:54Z2011-03-16T15:58:54ZWhat does setViewComponent() actually do<div><p>Hi Stray,</p>
<p>Thanks for the prompt answer, it was very helpful. Unfortunately
setComponentView doesn't do what I hoped it would, but at least I
know some more about the inner workings of our lovely
RobotLegs.</p>
<p>Cheers</p>
<p>Stephen</p></div>stephenadams1