Mediator: onRegister called before preRegister?

johncblandii's Avatar


07 May, 2010 05:13 PM

12:09:52.578 [INFO] views.mediators.ApplicationMediator onRegister()
12:09:52.602 [INFO] views.mediators.ApplicationMediator preRegister()

That's from my logging.

     * @inheritDoc
    override public function onRegister():void{

     * @inheritDoc
    override public function preRegister():void{

This is from my CoreMediator class which my mediators extend. My core merely manages initializing logging and doing some basic logging. After implementing it I noticed the logging showed on before pre, which doesn't make sense to me.

Am I misunderstanding the two methods?

  1. Support Staff 1 Posted by Shaun Smith on 07 May, 2010 05:24 PM

    Shaun Smith's Avatar

    preRegister is always called first, but sometimes it calls onRegister immediately:

    If you put your trace statements before the calls to super things should make a little more sense :)

  2. 2 Posted by johncblandii on 07 May, 2010 05:33 PM

    johncblandii's Avatar

    100% correct. :-)

    I moved my log messages above the super calls and the order is correct.


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

Keyboard shortcuts


? 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