You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by haipeng du <ha...@gmail.com> on 2009/06/22 22:18:57 UTC

life cycle for page render

In my page, I have one requirement to keep data in the request cycle and
discard it after response sent back. I will not use @Persist as it is not.
But, when I try to trace request processing, I got following when I click
submit button
(1) page attach method called
(2) event method is called
(3) page detach method is called (this time, it has already clean all
variables that are not marked as @Persist)
(4) page attach method called again
(5) Page detach method called again.
I wonder why attaching and detaching called twice, how could I keep my
variables in the first time calling.
Thanks.

-- 
Haipeng Du
Salt Lake City

Re: life cycle for page render

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Mon, 22 Jun 2009 17:18:57 -0300, haipeng du <ha...@gmail.com>  
escreveu:

> In my page, I have one requirement to keep data in the request cycle and
> discard it after response sent back. I will not use @Persist as it is  
> not.

Why not @Persist(PersistenceConstants.FLASH)?

> But, when I try to trace request processing, I got following when I click
> submit button
> (1) page attach method called
> (2) event method is called
> (3) page detach method is called (this time, it has already clean all
> variables that are not marked as @Persist)
> (4) page attach method called again
> (5) Page detach method called again.
> I wonder why attaching and detaching called twice, how could I keep my
> variables in the first time calling.

This happens when you are submitting a form or using an event link.  
Tapestry uses redirect-after-post by default, so this is expected (one  
request to submit the form or react to an event link, other to render the  
response.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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