Callout Mediator

di's Avatar

di

16 Nov, 2012 02:26 PM

I have someview which is handled by someviewmediator.
on someview there is a CalloutButton and on its click i have to open a calloutA
i have a calloutA which is handled by calloutAmediator. Now on the calloutA i have few selections i have to make and there are two buttons say buttonA and buttonB
on buttonA i have to push someview with the updated selections.
on buttonB i have to push someotherview which is handled by someotherviewmediator.

on the application context i am mapping the view n mediators
mediator.mapview(someview,someviewmediator);
mediator.mapview(calloutA,calloutAmediator);
mediator.mapview(someotherview,someotherviewmediator);

in someviewmediator on calloutButton Click i am trying to push the calloutA.
in calloutA mediator on buttonA and ButtonB clicks i am pushing the views

when i am doing this i get an error Coercion failed: cannot convert views::Callout@1290dae1 to spark.components.View.

how can i achieve it.

  1. Support Staff 1 Posted by Ondina D.F. on 16 Nov, 2012 03:52 PM

    Ondina D.F.'s Avatar

    See if you can use something like this:

    A ViewNavigator:
    var calloutNavigator:CalloutNavigator=injector.instantiate(CalloutNavigator);
    injector.mapValue(CalloutNavigator, calloutNavigator);
    mediatorMap.createMediator(calloutNavigator);

    A Callout:
    var someCallOutView:SomeCallOutView=injector.instantiate(SomeCallOutView);
    injector.mapValue(SomeCallOutView, someCallOutView);
    mediatorMap.createMediator(someCallOutView);

    someCallOutView.open(popUpOwner);
    someCallOutView.setPopUpData("SOME DATA");
    someCallOutView.calloutGroup.addElement(calloutNavigator);

    -*popUpOwner is a DisplayObjectContainer

    Ondina

  2. Support Staff 2 Posted by Ondina D.F. on 16 Nov, 2012 04:01 PM

    Ondina D.F.'s Avatar

    I’d let the CalloutNavigatorMediator call a method on CalloutNavigator (component), and within this method I’d push other views.

  3. Ondina D.F. closed this discussion on 20 Nov, 2012 10:15 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