You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Marcus Brito <mb...@gmail.com> on 2005/08/07 15:10:40 UTC

Re: tapestry CACHING issue

> When making it abstract getter/setter, will it do to
> set "initial-value" of <property-specification to the
> value that was set as class variables. I read
> somewhere that initial-value of property specification
> is set just before page is put back to pool. So feel
> that when class is instantiated, it will not have that
> initial-value.

That's correct. If you need to set property values or do any kind of
initialization *before* your page renders, implement PageAttachListener
interface. On the pageAttached() method, you can set your property values to
whatever you want.

If you're using Tapestry 3.0, there's no PageAttachListener -- instead, you can
implement PageRenderListener, and provide initialization on the
pageBeginRender() method.

-- Marcus Brito



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


Re: tapestry CACHING issue

Posted by Marcus Brito <mb...@gmail.com>.
> That's not correct. Upon (page) class instanciation, the initial-value
> is evaluated, set to the specified property 
> and finally cached so that it can be used again to reset the property when
> the page returnes to the pull.

Thanks for the correction, Andy. Worse than being wrong, is being wrong without
anyone to point out your mistakes/misunderstandings.

Anyway,the core of my explanation is still true: initial-value is not your best
option to initialize the page state; this is the task of pageBeginRender() and
friends.

-- Marcus Brito


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


Re: tapestry CACHING issue

Posted by an...@di.uoa.gr.
> > When making it abstract getter/setter, will it do to
> > set "initial-value" of <property-specification to the
> > value that was set as class variables. I read
> > somewhere that initial-value of property specification
> > is set just before page is put back to pool. So feel
> > that when class is instantiated, it will not have that
> > initial-value.
> 
> That's correct. 

That's not correct. Upon (page) class instanciation, the initial-value
is evaluated, set to the specified property 
and finally cached so that it can be used again to reset the property when
the page returnes to the pull.

Anyway, just give it a try.


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