You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Marcio E Miranda <Ma...@fastsearch.com> on 2006/04/17 22:58:53 UTC

Problem running custom JSF component inside a portlet.

Hi,

 

We have developed some custom JSF components, but are having some
trouble to make them work inside a portlet.

 

After some debugging, we have found out that a technique that we've
learned from the book "Pro JSF and AJAX" (which covers component
development) doesn't work in the MyFaces portlet implementation. The
technique consists of calling context.getRenderResponse() in the
constructor of the custom component to determine the first time the
component was rendered. This is used to add children components. The
constructor may be called again in the restore view, but the children
won't be re-created. This works because the first time restoreview is
called, the view will be created and renderResponse will be called,
forcing the render phase to be called next.

 

This technique doesn't work in the portlet implementation because the
first 5 phases are executed by processAction and the render phase is
executed by facesRender, which calls Lifecycle.render() directly
(context.setRenderPhase is never called). 

 

What does need to be changed in the portlet implementation to make this
technique work?

 

Thanks!

 

______________________
Marcio Miranda