Injecting Event inside mediator when mediator is adding dynamically

armen abrahamyan's Avatar

armen abrahamyan

21 Mar, 2011 02:56 PM

I have flex project. my second view is adding dynamically. So I'm maping mediator manually. The problem is that inside FlickrSelectedImageMediator i can't inject event.

In main context:

in the view mediator somewhere:
var selectedImage:FlcikrSelectedImage = PopUpManager.createPopUp(view, FlcikrSelectedImage, true) as FlcikrSelectedImage;
mediatorMap.createMediator( selectedImage );

inside FlickrSelectedImageMediator:
[Inject] public var flickrThumbDataEvent: FlickrThumbDataEvent

the last inject of event inside mediator gives error:
Error: Injector is missing a rule to handle injection into target [class FlickrThumbDataEvent]. Target dependency: String, method: constructor, parameter: 1

Thanks for the help!

  1. 1 Posted by armen abrahamya... on 21 Mar, 2011 09:37 PM

    armen abrahamyan's Avatar

    I find workaround of the problem...
    Moved mediatorMap.createMediator( selectedImage ); to the controller class, in the same place opening the actual view via popupmanager and passing data from mediator to view via model.

    working example:
    ThumbSelectCommand -> execute thats where everything is happening.


  2. Stray closed this discussion on 24 Mar, 2011 12:06 PM.

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