I have PrepareViewsCommand which sets up my mediators and views. Everything is working fine. But as soon as I add any line of code, my text inputs in my portal view cannot be editted anymore. I added a simple trace("TEST") line and it stops functioning. Anyone have any suggestions?
The project is based on Flex 3.4 and uses a code behind structure.
Here's the code of the PrepareViewsCommand:
package nl.tinqwise.coachandcoach.controller
{
import nl.tinqwise.coachandcoach.view.NavigationMediator;
import nl.tinqwise.coachandcoach.view.PortalMediator;
import nl.tinqwise.coachandcoach.view.TemplateContainerMediator;
import nl.tinqwise.coachandcoach.view.components.NavigationComponent;
import nl.tinqwise.coachandcoach.view.components.NavigationComponentClass;
import nl.tinqwise.coachandcoach.view.components.PortalComponent;
import nl.tinqwise.coachandcoach.view.components.PortalComponentClass;
import nl.tinqwise.coachandcoach.view.components.TemplateContainerComponent;
import nl.tinqwise.coachandcoach.view.components.TemplateContainerComponentClass;
import org.puremvc.as3.multicore.interfaces.INotification;
import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
import flash.display.DisplayObjectContainer;
/**
* @author Marco
* creates view components
* add's them to the displaylist
* creates mediators
* registers the mediators
*/
public class PrepareViewsCommand extends SimpleCommand {
private var _mainContainer : DisplayObjectContainer;
override public function execute( note : INotification ) : void
{
// Main container
trace("TEST");
_mainContainer = DisplayObjectContainer(note.getBody());
// States and pages
//Add Portal component and Mediator
var portal : PortalComponentClass = new PortalComponent() as PortalComponentClass;
_mainContainer.addChild( portal );
var portalMediator : PortalMediator = new PortalMediator( portal );
facade.registerMediator( portalMediator );
var templateContainer : TemplateContainerComponentClass = new TemplateContainerComponent() as TemplateContainerComponentClass;
_mainContainer.addChild( templateContainer );
var swfContainerMediator : TemplateContainerMediator = new TemplateContainerMediator( templateContainer );
facade.registerMediator( swfContainerMediator );
/*
* Add TipBoek component and Mediator
* Keep at bottom of this command to overlay other components
*/
// var tipBoek : TipBoekComponentClass = new TipBoekComponent() as TipBoekComponentClass;
// _mainContainer.addChild( tipBoek );
// var tipBoekMediator : TipBoekMediator = new TipBoekMediator( tipBoek );
// facade.registerMediator( tipBoekMediator );
/*
* Add Navigation component and Mediator
* Keep at bottom of this command to overlay other components
*/
var navigation : NavigationComponentClass = new NavigationComponent() as NavigationComponentClass;
_mainContainer.addChild( navigation );
var navigationMediator : NavigationMediator = new NavigationMediator( navigation );
facade.registerMediator( navigationMediator );
}
}
}