Created
July 13, 2010 09:18
-
-
Save FrancisVarga/473665 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private function onAddTestItemComplete(event : TestCenterEvent):void{ | |
logger.log("onAddTestItemComplet"); | |
var item : TestCenterItem = new TestCenterItem(); // create my view | |
item.dataProvider = event.testItemDataProvider as RequestItem; // add dataprovider | |
mediatorMap.createMediator(item); // create a mediator | |
view.centerContainer.addElement(item); // add it to stage | |
} |
Ofcuz in my ApplicationContext i have map my mediator to my view!
ok, yeah sorry on twitter is difficult to explain something in detail.
what I ended up doing is the following:
var myViewInstance:MyViewClass = new MyView();
mediatorMap.mapView(MyViewClass , MyViewMediator);
mediatorMap.createMediator(myViewInstance);
injector.mapValue(MyViewClass, myViewInstance);
as mentioned on twitter I set myViewInstance as a Singleton via the mapValue method so to have one instance throughout the app.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I take that somewhere you've done this:
mediatorMap.mapView(TestCenterItem, YourMediatorClass);