Same Mediator Class for different views in Context ?

vishwas.gagrani's Avatar

vishwas.gagrani

27 Jul, 2012 01:26 PM

I am using following code in Context :

                mediatorMap.mapView(StepsBoxPage1View, SceneMediator );
        mediatorMap.mapView(StepsBoxPage2View, SceneMediator );
        mediatorMap.mapView(StepsBoxPage3View, SceneMediator );
        mediatorMap.mapView(StepsBoxPage4View, SceneMediator );

I am wondering, if it will renew the same instance of SceneMediator overwriting the previous one OR would it create separate instances of scenemediator fr each view ?

thanks
V.

  1. 1 Posted by Stray on 27 Jul, 2012 01:34 PM

    Stray's Avatar

    each *instance* of each type of view will get its own SceneMediator.

    However, you'll normally need to use the 3rd parameter - 'injectViewAs' - in this situation, where you inject the view against the super type or shared interface of those views.

    eg

    mediatorMap.mapView(StepsBoxPage1View, SceneMediator, StepsBoxPageViewBase);

    hth,

    Stray

  2. vishwas.gagrani closed this discussion on 28 Jul, 2012 06:00 PM.

  3. vishwas.gagrani re-opened this discussion on 28 Jul, 2012 06:00 PM

  4. 2 Posted by vishwas.gagrani on 28 Jul, 2012 06:01 PM

    vishwas.gagrani's Avatar

    ok. thnx. Gonna try that out.

  5. vishwas.gagrani closed this discussion on 28 Jul, 2012 06:01 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