Mediator mapping and override error

dada's Avatar


05 Nov, 2013 04:21 AM

Hi all,

I read another thread about my problem (that is closed : but it doesn't help me.

WIth RobotLegs 1, I always used injection to instanciate my views, in addition of using view/mediator mapping.
Today, if I do this :; TimelineView ).toMediator( TimelineMediator );
I got an error cause of mapping override.
But if I remove the mapping as singleton, I can't inject my view into another view, and can't use injector to instanciate it.

So, the question : how to use injection to instanciate a view, while using view/mediator association ?


  1. Support Staff 1 Posted by Ondina D.F. on 05 Nov, 2013 09:32 AM

    Ondina D.F.'s Avatar

    Hey dada,

    Instead of the mediatorMap, use the viewProcessorMap, like this:; MediatorCreator(SomeMediator));;;

    or instead of mapping the view as singleton, you can map it like so:

    var someView:SomeView = new SomeView();;

    You could as well inject SomeView directly into views:

    Inside of AnotheView and ShellContextView: 
    public var someView:SomeView;


    var someView:SomeView = new SomeView();;;;

    Now, you have to know that when you add SomeView to ShellContextView, and then you want to add it to AnotherView as well, SomeView will be re-parented, i.e. first removed from ShellContextView and then added to AnotherView, and vice versa when you add it again to ShellContextView, so SomeMediator will be destroyed and created again.

    Does that answer your question?


  2. 2 Posted by dada on 05 Nov, 2013 11:53 AM

    dada's Avatar

    Yes, that works fine with the MediatorCreator, thank you for your help.

    Have a nice day|night.

  3. Support Staff 3 Posted by Ondina D.F. on 05 Nov, 2013 12:05 PM

    Ondina D.F.'s Avatar

    Glad it works.

    Thanks for the wishes, have a nice day/night, too :)

    I forgot to give you this link for more info on viewProcessorMap's usage:

  4. Ondina D.F. closed this discussion on 05 Nov, 2013 12:05 PM.

  5. dada re-opened this discussion on 05 Nov, 2013 12:06 PM

  6. 4 Posted by dada on 05 Nov, 2013 12:06 PM

    dada's Avatar

    Thanks for the link, I'll have a look at it.

  7. Ondina D.F. closed this discussion on 15 Nov, 2013 11:46 AM.

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

Keyboard shortcuts


? 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