tag:robotlegs.tenderapp.com,2009-10-18:/discussions/problems/568-startupcommandRobotlegs: Discussion 2018-10-18T16:35:39Ztag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T10:38:07Z2012-05-14T10:38:07ZStartupCommand<div><p>Hello, can you please post the message of the error that you are
receiving.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T10:42:51Z2012-05-14T10:45:19ZStartupCommand<div><p>hi krasimir,</p>
<p>i dont get the errors, its just that the next block of codes
inside my execute function is not running if model2 is
injected.</p>
<p>[Inject] public var model1:MyModel1;<br>
[Inject] public var model2:MyModel2;</p>
<p>inside my execute function, i have 2 urlloaders, one for a json
query and one for obtaining data from php.<br>
compiles fine w/o compile time error / runtime error.</p>
<p>thanks,<br>
carlos</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T10:49:04Z2012-05-14T10:49:04ZStartupCommand<div><p>For me it looks that something is no ok with your second model.
Can you please post the code which defines your injection.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T10:55:09Z2012-05-14T10:55:09ZStartupCommand<div><p>that's what i thought too - here's my 2nd model</p>
<p>package lib.model {</p>
<pre>
<code>import org.robotlegs.mvcs.Actor;
public class DateWidgetModel extends Actor {
private var _time:String;
public function DateWidgetModel(){
super();
}
public function set time(timeStr:String):void{
_time = timeStr;
}
}</code>
</pre>
<p>}</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:13:15Z2012-05-14T11:13:15ZStartupCommand<div><p>How did you inject your module.</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:15:58Z2012-05-14T11:16:21ZStartupCommand<div><p>i injected it in my startupcommand</p>
<p>[Inject] public var dateWidgetModel:DateWidgetModel;</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:20:12Z2012-05-14T11:20:12ZStartupCommand<div><p>Sorry, I meant the code that you are using to define the rule of
injection. Something like<br>
injector.mapValue(Class, instance);</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:24:23Z2012-05-14T11:24:24ZStartupCommand<div><p>sorry too here it is.</p>
<p>injector.mapSingleton(DateWidget);<br>
... mediatorMap.mapView(DateWidget, DateWidgetMediator);<br>
... contextView.addChild(new DateWidget());</p>
<p>many thanks,<br>
carlos</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:34:39Z2012-05-14T11:34:39ZStartupCommand<div><p>Are you sure that<br>
injector.mapSingleton(DateWidget);<br>
is correct. I guess it should be:<br>
injector.mapSingleton(DateWidgetModel);</p></div>krasimirtag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:39:56Z2012-05-14T11:40:22ZStartupCommand<div><p>cheers nailed it :)</p>
<p>many thanks sir krasimir ,<br>
carlos</p></div>kakarlustag:robotlegs.tenderapp.com,2009-10-18:Comment/159742362012-05-14T11:41:11Z2012-05-14T11:41:11ZStartupCommand<div><p>I'm glad that I helped ;)</p></div>krasimir