Shale's viewcontroller is not intrusive, The only limitation is that there can be only one view controller per page. And it is called after the view is restored/created.
 
If the page has more than one managed bean and the init mechanism is needed for those beans the following 2 ways can be considered (instead of calling an init method from a setter):
1. By using observer pattern with viewcontroller. Use shale's viewcontroller for the page and let the other managed beans which need the init/prerender/preprocess/destroy mechanism register themselves to the view controller from the constructor. Then in the viewcontroller's init/destroy/preprocess/prerender methods call the same methods for all the registered beans.
 
2. Creating a custom variable resolver. This method does not use shale's view controller. instead the custom variable resolver acts like a decorator to the existing resolver. Once the variable is resolved (the bean is instantiated and all the setters are called) call init.

 


On 3/15/06, Nicklas Karlsson <[EMAIL PROTECTED]> wrote:
Not the most elegant way but works for me.

I think I'll settle for something like that - I am overriding setServiceLocator and call the init method after the super()-call.
Seems to be working, and I prefer doing a documented "less-than-ideal" solution that introducing a new component into
the palette.
 

Reply via email to