tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/91-model-issueRobotlegs: Discussion 2018-10-18T16:35:12Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/16885862010-05-14T19:25:07Z2010-05-14T19:25:07ZModel Issue<div><p>Hi Jeremy,</p>
<p>sorry - your question / problem wasn't very clear. I understand
what you have, just not what you're trying to do and why you think
you can't do it.</p>
<p>If you wanted the formTemplate variable to be available
application wide then you could map it using
injector.mapValue(FormTemplates, this._formTemplate), and then
inject it in the other places you wish to use it. Of course these
objects would need to only be created AFTER you've mapped the
value, otherwise the object won't be there yet. (See the 3rd
solution if this is a problem).</p>
<p>Or... you could attach it as a property to the event that is
fired when it's created.</p>
<p>Or... you could inject a singleton here and in other places you
need the template that is simply an access point for this value.
FormTemplateHolder if you like. Crude but effective.</p>
<p>Not sure if any of those fix your problem - write more if you
need something different.</p>
<p>Stray</p></div>Straytag:robotlegs.tenderapp.com,2009-10-18:Comment/16885862010-05-14T20:06:01Z2011-01-10T11:16:36ZModel Issue<div><p>You are right I should have been more clear.</p>
<p>Starting off, after I create a new record the variable
formTemplate is populated and then I change a view stack on my
stage. This all works perfectly well.</p>
<p>The issue I am having is that when I select a record I want to
edit, I need to update formTemplate with the data in the model from
the selected record. What I am trying to do is figure out how to
just reuse the code above to achieve this with out dispatching the
event in the setter.</p></div>rottmanj