I'm new to Robotlegs, and somewhat struggling with the first steps. To learn the ropes I followed the first part of Joel Hooks' introduction and am now trying to create the same in RL2.
My current questions/problems are:
- Which method has replaced the startup() in the Context
- In the Context I can no longer just use "mediatorMap"; Do I need to create a MediatorMap Instance for this?
- In the few RL2 example out there, many devs use the IConfig to configure their main Context; is this required, a good convention or optional.
- ..and in which way, is the Context 'configured' through this?
I spent the best part of the day looking for solutions. I apologize if I missed the obvious. Thanks in advance for any incite.
part of the main class (mxml)
xmlns:context="contexts.*"
<fx:Declarations>
<rl:ContextBuilder>
<context:HelloWorldContext/>
</rl:ContextBuilder>
</fx:Declarations>
and the (non-compling) context .as
public class HelloWorldContext extends Context
{
public function HelloWorldContext()
{
this.install(MVCSBundle);
this.configure(HelloWorldConfig);
mediatorMap.map(ButtonView).toMediator(ButtonMediator); // Error: mediatorMap not defined
}
}
use
context.install
to install extension that you want to use. most common one isMVCSBundle
. usecontext.configure
with(new ContextView)
argument will start your context initialization.If you implement IConfig inside config, you dont need [PostConstruct] tag, because robotlegs will call configure function automatically once the dependencies have been injected.
in your case you will have
mediator thing goes to config on mapMediators();