Module content only loads correctly on second load.

jeremy.brooks's Avatar

jeremy.brooks

29 Aug, 2012 03:29 PM

Hi,

I am using the Modular utility and RL 1.5.2 with Flex SDK 4.0.

When I start up my modular application, the code to load the first module seems to work fine, however the content loaded (ie the module) isn't displayed. I have a button that reloads the module, and this displays the content fine.

At start up the initial module loading process is only triggered after the 'controlling shell' context's startup method has finished. The last thing the startup method does is dispatchToModules an event to say that it has finished mapping views/commands etc. the event is picked up by a context listener by a mediator, and successfully hits an associated function. At this point whilst debugging, the context is shown as null, I believe this is my problem because it is here when I load the module.

Is there another stage after the startup method is called that I should dispatch my event from? or perhaps I have gone at this from the wrong angle altogether?

Basically I just need to notify other modules that the main shell's context has finished all of its mapping procedures, and things are ready to rock'n'roll.

  1. 1 Posted by jeremy.brooks on 29 Aug, 2012 04:10 PM

    jeremy.brooks's Avatar

    Ok I've just been going through my code with a colleague and identified the bug. It was because at start up, the IModuleInfo object I was using to load the module was being blown away by the garbage collector. As soon as I created a private variable within my mediator and assigned it to that instead of just referring to it via the event variable, things worked fine.

    It would seem that after the first load, the garbage collector is not so greedy and allows the reference to hang around and the module loads fine.

  2. Ondina D.F. closed this discussion on 31 Aug, 2012 08:50 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac