Performing injection into Views in RL2

philostler's Avatar

philostler

25 Feb, 2013 04:57 PM

In RL1 I could perform the following to get automatic injection of dependencies into views.

[Inject] public var viewMap:IViewMap; & then viewMap.mapType(MyView);

In Robotlegs 2 I'm a little lost as to how to achieve the same effect. I've taken a look at ViewProcessorMapExtension which looked promising but I've hit a dead end with all my examples failing to work.

Can anyone give me insight into how to get this functionality back for Robotlegs 2?

Thanks

  1. Support Staff 1 Posted by Ondina D.F. on 25 Feb, 2013 05:10 PM

    Ondina D.F.'s Avatar
  2. Support Staff 2 Posted by Ondina D.F. on 25 Feb, 2013 05:16 PM

    Ondina D.F.'s Avatar

    And this one too:
    http://knowledge.robotlegs.org/discussions/questions/2000-passing-d...

    Not the best examples, but that's all I can offer you at the moment...

  3. 3 Posted by philostler on 26 Feb, 2013 09:47 AM

    philostler's Avatar

    Thanks. I'll dive in later today and see if I can get any joy out of it via the examples

  4. 4 Posted by philostler on 26 Feb, 2013 05:18 PM

    philostler's Avatar

    Root of my problem appears to be that I'm using the SARS extension and Robotlegs isn't performing injection on views being added to the stage on my multiple instances of Starling (although it can see them being added as mediators are being created)

    My solution is to process the view in the mediator as follows...

    [Inject]
    public var view:MyView;
    [Inject]
    public var viewProcessorMap:IViewProcessorMap;
    //
    public override function initialize():void {
        viewProcessorMap.process(view);
    }
    

    This works well enough for me atm. Thanks for your help!

  5. philostler closed this discussion on 27 Feb, 2013 09:33 AM.

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