Mariano Petrakovsky wrote:
Simon, you can send me the source code of this render wrapper?

I don't understand the complete idea... maybe if i look the code, i do.


Sorry. Mariano, but there is no such code. I was just suggesting that it seemed to be possible to solve the problem that way.

The point is that you need to have custom code run before each component is rendered, but a phase listener can't do that for the first view of the page when JSP is used.

However the *renderer* can do that. You can't subclass every single JSF renderer to add the custom code; that's far too much work. However you could *wrap* every standard renderer in a class that calls your custom code before delegating to the real renderer.

Now renderers are "registered" by calling a method on the Application class (or is it the ViewHandler? I don't have the JSF specs to hand just now, or my earlier email). So by substituting your own implementation here you can ensure that as each renderer is added during MyFaces startup it is wrapped with your custom wrapper.

Regards,

Simon

Reply via email to