tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/161-injecting-into-a-datarenderer-or-itemrendererRobotlegs: Discussion 2013-06-20T02:43:30Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-06-03T16:29:07Z2013-06-20T02:43:30ZInjecting into a DataRenderer or ItemRenderer<div><p>Ran across another issue with injecting into item/data
renderers. If you enable drag & drop for a list... the
injections don't happen when creating the drag-proxy. This is
because the drag-proxy gets added to the SystemManager vs. within
the context/happy injection land.</p></div>beaubrewertag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-06-03T16:36:47Z2010-06-03T16:36:47ZInjecting into a DataRenderer or ItemRenderer<div><p>I send events up from the items to the list, treating the items
as encapsulated private members of the list. This seems like it
would work here as well, and solve all of the oddities you
experience with trying to inject into items.</p>
<p>You can also use SystemManager as the contextView. Not really
recommended, but it works well if you aren't planning on any sort
of modularity.</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-06-05T20:23:19Z2013-06-20T02:43:30ZInjecting into a DataRenderer or ItemRenderer<div><p>Thanks Joel. I think I just took using signals as a way of not
using native events way to far in my head. :) Do you use the owner
property of the itemRenderer or just dispatch an event? I'm using a
spark list (if that matters). Any snippet of code you could offer
would be great.</p></div>beaubrewertag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-08-13T09:19:13Z2010-08-13T09:19:13ZInjecting into a DataRenderer or ItemRenderer<div><p>btw I'm not really sure what you use viewMap.mapType() for, is there a easy doc for this, as I can't figure it out from the source</p></div>Nikos tag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-08-13T13:54:26Z2010-08-13T13:54:26ZInjecting into a DataRenderer or ItemRenderer<div><p>The ViewMap is an alternative to the MediatorMap. Although both can be used in the same project there are performance implications in the current version of Robotlegs if you do.</p>
<p>Instead of creating a Mediator when a view component lands on stage, the ViewMap simply performs injection directly into that view component. Some people don't like the Mediator pattern, and prefer to inject "Presenters" (or other dependencies) directly into their view components.</p>
<p>Hopefully in RL v2.x we'll come up with a performant solution to allow many different kinds of "view related" maps.</p></div>Shaun Smithtag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-08-13T14:27:02Z2010-08-13T14:27:02ZInjecting into a DataRenderer or ItemRenderer<div><p>"applause" :)</p>
<p>So presenters properties are bound to the view components? But can presenters still perform logic on the view once they are injected?<br />
</p></div>Nikos tag:robotlegs.tenderapp.com,2009-10-18:Comment/16703092010-08-13T14:38:21Z2010-08-13T14:38:21ZInjecting into a DataRenderer or ItemRenderer<div><p>Not bound, just injected. The view could, however, call a method on the presenter post injection informing the presenter of itself, but that doesn't really fit my understanding of the pattern.</p></div>Shaun Smith