Hi. I'm using FlexMDI and I'd like to know what is the best approach to instantiate a component that has an injected model (presentation model pattern) and it's not instantiated through mxml. Something like this:
PHP Code:
var mdiWindow:MDIWindow = new MDIWindow();
mdiWindow.addChild(new MyComponent());
mdiCanvas.windowManager.add(mdiWindow);
If MyComponent has a model, it won't be instantiated by Spring (even if MyComponent is written using mxml). So, what can I do?
I know I could inject the component itself too (let Spring manage it), but I'd like to know if there is a different approach, because I wouldn't like to configure all my components in the applicationContext file, just their model.
Thanks in advance.