You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Skriloff, Nicholas" <Sk...@darden.virginia.edu> on 2006/02/22 17:41:26 UTC

PageBeginRender vs RenderComponent

What I do not understand is that in a component you can implement
pageRenderListener and in a page you can implement pageRenderListener.  

What is the purpose of implementing pageRenderListener ,and when in the
request lifecycle does it happen(what event happens before and after
it), in a java class implemented by a .PAGE file?
What is the purpose of implementing pageRenderListener, and when in the
request lifecycle does it happen (what event happens before and after
it), in a java class implemented by a .JWC file?
What is the purpose of using renderComponent when extending
baseComponent, and when in the request lifecycle does it happen (what
event happens before and after it), in a java class implemented by a
.JWC file?

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: PageBeginRender vs RenderComponent

Posted by Kent Tong <ke...@cpttm.org.mo>.
Skriloff, Nicholas <SkriloffN <at> darden.virginia.edu> writes:

> What is the purpose of implementing pageRenderListener ,and when in the
> request lifecycle does it happen(what event happens before and after
> it), in a java class implemented by a .PAGE file?
> What is the purpose of implementing pageRenderListener, and when in the
> request lifecycle does it happen (what event happens before and after
> it), in a java class implemented by a .JWC file?

If a component is in a page and implements PageBeginRenderListener,
then its pageBeginRender() method will be called before the page 
starts to render. Note that the component later may end up rendering
itself 0 time (if it is contained in an IF), once or many times 
(in a For). If you need to perform something every time before it's 
rendered, you should implement preapreForRender() instead (no need to 
override renderComponent).

In pageBeginRender() the component usually performs something that 
needs to be done exactly once, no matter how many times it will be 
rendered (eg, reading data from Visit or loading a small DB table).

--
Author of a book for learning Tapestry (www.agileskills2.org/EWDT)


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org