No one is listening...
Hi,
hi,
Im a bit of a noob to the RL framework. Ive managed to
successfully wire things up to mediate my views, but I am having
some issues with startup. It seems my views are ready before the RL
framework. So, when my views fire off their 'im ready give me stuff
events', the mediators are not ready to listen. I have played
around with a startup command a bit... but this didnt seem to
help.
Whats the proper way to notify when the RL framework with startup/initiation and is ready for work?
Many thanks,
-greg
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by creynders on 26 Mar, 2011 12:12 PM
Basically you have two options:
1/wait with instantiating your views until your framework is ready
2/manually instantiate your mediators at startup for the views that have already been instantiated
http://api.robotlegs.org/org/robotlegs/base/MediatorMap.html#create...
3 Posted by Greg on 26 Mar, 2011 12:37 PM
thank you.
ill give one/both of these a whirl. one follow-up, how do i know when the framework is ready? again, i thought the startup/startup complete events would help detect that, but i was probably doing something wrong. :/
4 Posted by Michal Wroblewski on 26 Mar, 2011 01:07 PM
BTW. Did you manage to instantiate your app Context in main app view?
5 Posted by Greg on 26 Mar, 2011 01:15 PM
Yes... and with the exception of the startup task associated with one of my views... things otherwise function as intended... I just need to do some more studying to get more familiar with the timing of things, to get that issue straightened out.
Support Staff 6 Posted by creynders on 27 Mar, 2011 11:14 AM
You have to define where the ContextEvent.STARTUP is dispatched.
Most of the times this is in the startup method of the context class.
Beware: the original, inherited startup method dispatches the ContextEvent.STARTUP_COMPLETE event automatically, which means that if your bootstrap sequence contains any asynchronous calls, the STARTUP_COMPLETE event wil be dispatched BEFORE your calls have finished. You'll have to dispatch that event yourself then and remove the super.startup() line from your context class' startup method
7 Posted by Greg on 27 Mar, 2011 02:37 PM
I think the light is dawning... Thank you all!
Stray closed this discussion on 02 Apr, 2011 11:44 AM.