开发者

Duplication of Mediators in Robotlegs AS3 MVCS

开发者 https://www.devze.com 2022-12-20 14:20 出处:网络
I\'m using robot legs framework and wondering how mediator.mapView works with multiple instances of the same view. For example, in the following, is a new ItemDisplayMediator created for every ItemDis

I'm using robot legs framework and wondering how mediator.mapView works with multiple instances of the same view. For example, in the following, is a new ItemDisplayMediator created for every ItemDisplay instantiated, or do all ItemDisplay's use the same mediator? If they each instantiate a new mediator, is it possible to use a single mediator for multiples of the same class/view?

mediatorMap.开发者_如何学运维mapView(ItemDisplay, ItemDisplayMediator);


Each view instance is mediated by a different Mediator instance.

If you want a single mediator for multiple items, then create a Mediator for a container and mediate its children.


alecmce is correct, the MediatorMap is going to apply a new instance of the mediator to each instance of the view that is being mediated comes onto the stage. A mediator, as it is written in robotlegs, is only equipped to handle a single view component at any given time. The actual mediator isn't injected anywhere, so it isn't mapped with the injector.

0

精彩评论

暂无评论...
验证码 换一张
取 消