You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by tovarisch <is...@gmail.com> on 2007/06/13 11:08:18 UTC

T5: Page lifecycle and pageAttached()

Hi all,

I'm using 5.0.4, I have two pages, Page1 and Page2, similar to this:

Page1.html
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" >
<head><title>Page 1</title></head>
<body>
<t:pagelink page="page2">Page 2</t:pagelink>
</body>
</html>

Page2.html
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" >
<head><title>Page 2</title></head>
<body>
<t:pagelink page="page1">Page 1</t:pagelink>
</body>
</html>

where both pageAttached() and pageDetached() just log the call.

When Page1 is just loaded, the log is:
Page1.pageAttached
Page2.pageAttached
Page1.pageDetached
Page2.pageDetached

Why is Page2 attached to the request? If I have a menu with some pagelinks,
all of them are being attached and detached every call. 

If this behavior is correct, where is the place to load database content to
show in a page? If the page has a form, onPrepare() does the work, but what
about a page with no form and no context? Is onActivate() the method I'm
looking for?

Thanks.
-- 
View this message in context: http://www.nabble.com/T5%3A-Page-lifecycle-and-pageAttached%28%29-tf3913466.html#a11095596
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


Re: T5: Page lifecycle and pageAttached()

Posted by Howard Lewis Ship <hl...@gmail.com>.
This behavior is correct.

Page2 is attach to the request because of the PageLink component.

The PageLink component (or rather, the LinkFactory service behind the
scenes) obtains an instance of Page2 so that it can fire the
"passivate" event on it.

http://tapestry.apache.org/tapestry5/tapestry-core/guide/pagenav.html


On 6/13/07, tovarisch <is...@gmail.com> wrote:
>
> Hi all,
>
> I'm using 5.0.4, I have two pages, Page1 and Page2, similar to this:
>
> Page1.html
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" >
> <head><title>Page 1</title></head>
> <body>
> <t:pagelink page="page2">Page 2</t:pagelink>
> </body>
> </html>
>
> Page2.html
> <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd" >
> <head><title>Page 2</title></head>
> <body>
> <t:pagelink page="page1">Page 1</t:pagelink>
> </body>
> </html>
>
> where both pageAttached() and pageDetached() just log the call.
>
> When Page1 is just loaded, the log is:
> Page1.pageAttached
> Page2.pageAttached
> Page1.pageDetached
> Page2.pageDetached
>
> Why is Page2 attached to the request? If I have a menu with some pagelinks,
> all of them are being attached and detached every call.
>
> If this behavior is correct, where is the place to load database content to
> show in a page? If the page has a form, onPrepare() does the work, but what
> about a page with no form and no context? Is onActivate() the method I'm
> looking for?
>
> Thanks.
> --
> View this message in context: http://www.nabble.com/T5%3A-Page-lifecycle-and-pageAttached%28%29-tf3913466.html#a11095596
> Sent from the Tapestry - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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