StartupCommand

kakarlus's Avatar

kakarlus

14 May, 2012 10:12 AM

hi guys,

i got a problem with my startup command when i inject another model in it. is this something illegal in rl framework?
when i remove the one i injected, it works fine.

thanks,
carlos

  1. 2 Posted by krasimir on 14 May, 2012 10:38 AM

    krasimir's Avatar

    Hello, can you please post the message of the error that you are receiving.

  2. 3 Posted by kakarlus on 14 May, 2012 10:42 AM

    kakarlus's Avatar

    hi krasimir,

    i dont get the errors, its just that the next block of codes inside my execute function is not running if model2 is injected.

    [Inject] public var model1:MyModel1;
    [Inject] public var model2:MyModel2;

    inside my execute function, i have 2 urlloaders, one for a json query and one for obtaining data from php.
    compiles fine w/o compile time error / runtime error.

    thanks,
    carlos

  3. 4 Posted by krasimir on 14 May, 2012 10:49 AM

    krasimir's Avatar

    For me it looks that something is no ok with your second model. Can you please post the code which defines your injection.

  4. 5 Posted by kakarlus on 14 May, 2012 10:55 AM

    kakarlus's Avatar

    that's what i thought too - here's my 2nd model

    package lib.model {

    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;
        }
    }
    

    }

  5. 6 Posted by krasimir on 14 May, 2012 11:13 AM

    krasimir's Avatar

    How did you inject your module.

  6. 7 Posted by kakarlus on 14 May, 2012 11:15 AM

    kakarlus's Avatar

    i injected it in my startupcommand

    [Inject] public var dateWidgetModel:DateWidgetModel;

  7. 8 Posted by krasimir on 14 May, 2012 11:20 AM

    krasimir's Avatar

    Sorry, I meant the code that you are using to define the rule of injection. Something like
    injector.mapValue(Class, instance);

  8. 9 Posted by kakarlus on 14 May, 2012 11:24 AM

    kakarlus's Avatar

    sorry too here it is.

    injector.mapSingleton(DateWidget);
    ... mediatorMap.mapView(DateWidget, DateWidgetMediator);
    ... contextView.addChild(new DateWidget());

    many thanks,
    carlos

  9. 10 Posted by krasimir on 14 May, 2012 11:34 AM

    krasimir's Avatar

    Are you sure that
    injector.mapSingleton(DateWidget);
    is correct. I guess it should be:
    injector.mapSingleton(DateWidgetModel);

  10. 11 Posted by kakarlus on 14 May, 2012 11:39 AM

    kakarlus's Avatar

    cheers nailed it :)

    many thanks sir krasimir ,
    carlos

  11. 12 Posted by krasimir on 14 May, 2012 11:41 AM

    krasimir's Avatar

    I'm glad that I helped ;)

  12. Ondina D.F. closed this discussion on 14 May, 2012 12:08 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac