onRegister( ) for Model?

roland's Avatar


29 Dec, 2009 09:38 AM

I just run into a little problem.
I have a Proxy working correctly. Now I want the Proxy to listen to some Events using the eventMap. Now it would be nice
if the Proxy registers for events on its own, so I tried to map for certain events in the constructor of the Proxy.
Problem is, that the eventDispatcher property is null during calling the constructor. I know that Mediators have a
onRegister Function which is triggered automatically. Is there something like that for a Model too or am I on the wrong

Thank you,


  1. Support Staff 1 Posted by Till Schneidere... on 29 Dec, 2009 11:17 AM

    Till Schneidereit's Avatar

    Hey Roland,

    you can annotate methods of your Proxy with [PostConstruct] metadata
    to have them automatically invoked after all dependencies have been

    See the SwiftSuspenders documentation for details:


  2. 2 Posted by roland on 29 Dec, 2009 11:44 AM

    roland's Avatar

    Hi Till,
    thank you very much. That was exactly I was looking for.
    Please mark this problem as solved.


  3. Till Schneidereit closed this discussion on 29 Dec, 2009 12:16 PM.

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