Adding none visual items when a visual components is to be passed as a parameter

Gary Paluk's Avatar

Gary Paluk

21 Oct, 2012 03:31 AM

I am wanting to mediate a none visual component, so in my BootstrapViewMediators mediator I have the following view/mediator mapping code:

// register non visual components
mediatorMap.mapView( TransitionManagerView, TransitionManagerViewMediator, null, false, false );

// instantiate non visual components
mediatorMap.createMediator( new TransitionManagerView( ) );

However, my problem is that the TransitionManagerView extends a TransitionManager which accepts a visual object of type ScreenNavigator in the constructor.

I've taken a look around and can't find any example of what is the best approach when faced with this situation.

Help would be greatly appreciated, thanks in advance.

Gary Paluk

  1. Support Staff 1 Posted by Ondina D.F. on 22 Oct, 2012 07:16 AM

    Ondina D.F.'s Avatar

    Hi Gary,

    There are a couple of discussions around this topic on this forum:

    http://knowledge.robotlegs.org/discussions/questions/664-mediating-...

    http://knowledge.robotlegs.org/discussions/questions/833-how-do-i-c...

    http://knowledge.robotlegs.org/discussions/questions/904-mediating-...

    Please let us know whether they answer your question or not.

    hth
    Ondina

  2. 2 Posted by gary on 22 Oct, 2012 11:08 AM

    's Avatar

    Whilst these topics talk about things related to none visual items being injected and mediated (which I actually provided an example of), they do not answer my original question.

  3. Support Staff 3 Posted by Ondina D.F. on 22 Oct, 2012 02:37 PM

    Ondina D.F.'s Avatar

    What exactly is not working?
    Have you tried injecting the view into TransitionManagerView?

    I don’t know if something like the following is addressing your problem, but from what you said, that’s what I understand:

    In the Context

    injector.mapClass(TransitionManagerView,TransitionManagerView);
    injector.mapValue(SomeViewStack, new SomeViewStack());
    

    TransitionManagerView:

    [Inject]     
    public var someView:someViewStack;
    public function TransitionManagerView()
    {       
         super(someView);
    }
    

    TransitionManager:

    private var _view:ViewStack;
    public function TransitionManager(view:ViewStack)
    {
        _view=view;         
    }
    //...do something with the view
    

    Where you need TransitionManagerView:

    var transManager:TransitionManagerView=injector.getInstance(TransitionManagerView);          
    mediatorMap.createMediator(transManager);
    

    hth

  4. Ondina D.F. closed this discussion on 29 Oct, 2012 03:47 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