tag:robotlegs.tenderapp.com,2009-10-18:/discussions/questions/729-creating-child-views-dynamically-and-adding-to-parent-viewRobotlegs: Discussion 2012-08-29T16:25:03Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/116056982011-11-22T20:41:16Z2011-11-22T20:41:16ZCreating child views dynamically and adding to parent view<div><p>The only way I can really think is to dispatch an event from the
view that is caught and triggers a command to create the views and
then dispatch out another event with those views as a payload and
have the mediator on the parent view tell it's mediated view to add
those new child views to its display list. But that feels
cumbersome to me.</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/116056982011-11-22T20:48:54Z2011-11-22T20:48:54ZCreating child views dynamically and adding to parent view<div><p>Or maybe I can create a ChildViewFactory with a reference to the
injector? And then inject the factory into the ParentView and have
the ParentView use the factor to create the children?</p>
<p>Sorry, I'm new to RobotLegs and trying to figure it all out.</p>
<p>Kyle</p></div>kamcknigtag:robotlegs.tenderapp.com,2009-10-18:Comment/116056982011-11-22T22:33:44Z2011-11-22T22:33:44ZCreating child views dynamically and adding to parent view<div><p>Hi Kyle - sorry for the delay. yes - a factory that you inject
into the parent view would be a good solution.</p>
<p>Don't forget that you can do 'manual DI' - so you could inject
that factory into the parent view's mediator and pass it to the
parent view, for example.</p>
<p>Let us know if you need any more pointers,</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/116056982011-11-23T01:39:34Z2011-11-23T01:39:34ZCreating child views dynamically and adding to parent view<div><p>No worries! I was just working through it in my head and it
helps to write it out :)</p>
<p>Thanks!</p></div>kamcknig