You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Athneria, Mahendra" <ma...@atos.net> on 2012/08/28 11:48:18 UTC

When to use SetupRender and PageAttached methods

Hi,

I am confused about when to use SetupRender and PageAttached methods. I know that PageAttached methods comes in Page Lifecycle and SetupRender methods comes in Component rendering phase cycle.

It means PageAttached should belong to the Page and SetupRender belong to the Components. To verify the same I have created one Component and one Page

package net.xyz.components;

public class FooterComponent {

@PageAttached
Public void compAttached(){
System.out.println("in Component compAttached: ")
}

@SetupRender
Public void compRender(){
System.out.println("in Component compRender: ")
}

}

package net.xyz.pages;

public class LoginPage {

@PageAttached
Public void pageAttached(){
System.out.println("in Page pageAttached: ")
}

@SetupRender
Public void pageRender(){
System.out.println("in Page pageRender: ")
}

}

My LoginPage contain FooterComponent.

When I run my page in console I'll get sysout for PageAttached in Page as well as in component. Same for the setuprender method.

Can someone please explain me why it is happening?

Regards,
Mahendra


Re: When to use SetupRender and PageAttached methods

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Aug 2012 09:13:24 -0300, Athneria, Mahendra  
<ma...@atos.net> wrote:

> Hi Thiago H. de Paula Figueiredo,

Hi!

> I got it that PageAttached is something that made sense when Tapestry  
> pooled page instance. But my doubt is why it is getting called when I  
> write @PageAttahced in components?

Probably because it wasn't removed from Tapestry yet. Anyway, don't use it.

-- 
Thiago H. de Paula Figueiredo

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


RE: When to use SetupRender and PageAttached methods

Posted by "Athneria, Mahendra" <ma...@atos.net>.
Hi Thiago H. de Paula Figueiredo,

I got it that PageAttached is something that made sense when Tapestry pooled page instance. But my doubt is why it is getting called when I write @PageAttahced in components?

Regards,
Mahendra

-----Original Message-----
From: Thiago H de Paula Figueiredo [mailto:thiagohp@gmail.com] 
Sent: Tuesday, August 28, 2012 5:36 PM
To: Tapestry users
Subject: Re: When to use SetupRender and PageAttached methods

On Tue, 28 Aug 2012 06:48:18 -0300, Athneria, Mahendra  
<ma...@atos.net> wrote:

> Hi,

Hi!

> I am confused about when to use SetupRender and PageAttached methods. I  
> know that PageAttached methods comes in Page Lifecycle and SetupRender  
> methods comes in Component rendering phase cycle.

PageAttached is something that made sense when Tapestry pooled page  
instances, so you shouldn't use it anymore. Use SetupRender instead.

-- 
Thiago H. de Paula Figueiredo

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



Re: When to use SetupRender and PageAttached methods

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Tue, 28 Aug 2012 06:48:18 -0300, Athneria, Mahendra  
<ma...@atos.net> wrote:

> Hi,

Hi!

> I am confused about when to use SetupRender and PageAttached methods. I  
> know that PageAttached methods comes in Page Lifecycle and SetupRender  
> methods comes in Component rendering phase cycle.

PageAttached is something that made sense when Tapestry pooled page  
instances, so you shouldn't use it anymore. Use SetupRender instead.

-- 
Thiago H. de Paula Figueiredo

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


Re: When to use SetupRender and PageAttached methods

Posted by Lance Java <la...@googlemail.com>.
A page is a (specialized) component so it has all of the component rendering
events. I've never used @PageAttached in a component but I'm assuming that
tapestry is giving you access to the containing Page's lifecycle events.



--
View this message in context: http://tapestry.1045711.n5.nabble.com/When-to-use-SetupRender-and-PageAttached-methods-tp5715836p5715838.html
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