tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/59-moltiple-views-one-modelRobotlegs: Discussion 2018-10-18T16:35:10Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/12262172010-03-16T18:35:08Z2010-03-16T18:35:08ZMoltiple views, one model<div><p>Quick note; when I want to create a view of that component, I'm
just adding it to the display list.</p></div>oscartag:robotlegs.tenderapp.com,2009-10-18:Comment/12262172010-03-16T18:36:58Z2010-03-16T18:36:58ZMoltiple views, one model<div><p>If you want each of your mediators to have a unique instance
of<br>
MyViewModel, you'll have to change "injector.mapSingleton" to<br>
"injector.mapClass". That way, the injector creates a new instance
for each injection.</p>
<p>As for the events, that doesn't sound right. Can you maybe
create an<br>
example of this happening that doesn't contain any of your
proprietary<br>
code? Without that, it's hard to tell what's going on.</p></div>Till Schneidereittag:robotlegs.tenderapp.com,2009-10-18:Comment/12262172010-03-16T19:05:27Z2010-03-16T19:05:27ZMoltiple views, one model<div><p>Yes, the "injector.mapClass" does the trick. How can I access
the model I need from a command?</p>
<p>Should I insert the model into the mediator and have the
mediator to listen for the events and interact with the models?</p></div>oscartag:robotlegs.tenderapp.com,2009-10-18:Comment/12262172010-03-16T19:10:50Z2010-03-16T19:10:50ZMoltiple views, one model<div><p>One approach for the command would be to have the model as a
parameter to the event that triggers the command, otherwise you
will need to create a registry of some sort (a model of models with
unique identifiers)</p></div>Joel Hookstag:robotlegs.tenderapp.com,2009-10-18:Comment/12262172010-03-17T23:41:37Z2010-03-17T23:41:37ZMoltiple views, one model<div><p>tks.</p></div>oscar