Skip to content

An extension for Spring Actionscript 1 which enables you to create a context for a subview of your application.

Notifications You must be signed in to change notification settings

SlevinBE/Springas-subviewcontext

Repository files navigation

Introduction

An extension for Spring Actionscript 1 which enables you to create a context for a subview of your application, just like it’s
already possible for modules.

Important!

This extension is made for spring-actionscript 1.×. It won’t be necessary to use this extension for spring-actionscript 2.0
since this functionality will be build in.

How to use the extension

Setup

1. The first thing you need to do is to define an applicationContext for your subview, this
applicationContext will contain the objects specific for your subview (like presentationmodels, mediators, models,…).

2. Then you have to instantiate your context in your subview, like this:

_tabApplicationContext = new RootComponentXMLApplicationContext(this); // this == the subview
_tabApplicationContext.parent = parentApplicationContext;
_tabApplicationContext.addConfigLocation(“applicationSubViewContext.xml”);
_tabApplicationContext.load();

3. from now on the dependencies of your subview and its subcomponents will be automatically injected when they get instantiated.

Popups

Popups are somewhat special when it comes to injection. Because popups aren’t added to the default displayList it’s
impossible for the extension to know when the popup is added to the view. Therefore you have to manually register the popup
with the applicationContext. Follow these steps to do this:

1. define the AutowireViewRegistrator class as a singleton in your subview applicationContext.

2. define a property of type IViewRegistrator in the class where the popup is created, like this:

[Autowired]
public var viewRegistrator:IViewRegistrator;

3. then register the popup with the viewRegistrator:

viewRegistrator.registerView(popup);

4. from now on your popup (and any new subcomponents) will get autowired.

About

An extension for Spring Actionscript 1 which enables you to create a context for a subview of your application.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published