|
|
Date: 2005-01-31T19:33:05
Editor: KentTong
Wiki: Jakarta Tapestry Wiki
Page: MoreFrequentlyAskedQuestions
URL: http://wiki.apache.org/jakarta-tapestry/MoreFrequentlyAskedQuestions
no comment
Change Log:
------------------------------------------------------------------------------
@@ -5,6 +5,8 @@
Don?t worry; you aren?t the first person to make this mistake. Initialize
isn?t called when a page is created ? it is called when a page is returned to
the pool to be reused. Initialize is not to be used to setup a page but
instead return it to a pristine state so it can be recycled in the pool of
available pages. See the pageRenderListener interface if you want to setup
state before a page is used.
+KentTong: I don't think this is true anymore (not sure if it was true in the
past). Initialize is indeed called when a page is created. It is also called
when it is returned to the pool. So it can be used to setup a page to some
fixed initial state. Of course, you could do that using a
<property-specification> too.
+
== Where do I ?initialize? values for a page? ==
You?ll probably want to use the pageRenderListener class to perform any work
you need when the page is accessed. Alternatively you can do some lazy
initialization where objects are created the first time they are used. This
isn?t as clean as using Tapestry properties but it should work. For example:
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-dev-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: tapestry-dev-help@xxxxxxxxxxxxxxxxxx
|
|