how can i switch 2 mediators via 1 view?

katopz's Avatar

katopz

18 Feb, 2011 08:21 AM

i'm try to unmap BMediator from BaseView and then map AMediator to BaseView, easy as that
i know it's kinda bad practice here (as i read), but i just curios that why it just didn't work an gave me error instead

i do follow http://knowledge.robotlegs.org/discussions/questions/50-best-place-...
but i get Error: Injector is missing a rule to handle injection into target [object AMediator]. Target dependency: BaseView
eventually after this line

// Instantiate a new mediator and satisfy its dependencies mediatorMap.createMediator(view);

even remap same old BMediator to BaseView didn't seem to work (same error)

please see attach for src, fyi i use robotlegs 1.4.0, SwiftSuspenders v1.5.1
any help would be appreciate, i can't sleep well for 2 days for this, it keep running in my head ;o

  1. Support Staff 1 Posted by Till Schneidere... on 18 Feb, 2011 09:23 AM

    Till Schneidereit's Avatar

    One quick question, without having looked at the source:

    Are the views you're mapping to extending BaseView or are you really
    mapping to BaseView itself?

    If the former, you need to change your `mapView` invocation and add
    the parameter `injectViewAs`:
    mediatorMap.mapView(AView, AMediator, BaseView); // assuming you want
    to map a view called `AView`

    If that's completely off the mark, then please say so and I will have
    a look at the sources.

  2. 2 Posted by katopz on 18 Feb, 2011 09:49 AM

    katopz's Avatar

    Thx, for reply, actually it's not extend BaseView there it's just SomeView
    Sorry if that class name seem to be confuse, I do plan for testing that AView things really later (obviously after this simple 1 view work)

  3. Support Staff 3 Posted by Till Schneidere... on 18 Feb, 2011 09:55 AM

    Till Schneidereit's Avatar

    Ok, I'll have a look at the source and get back to you then.

  4. Stray closed this discussion on 29 Apr, 2011 06:22 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