You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Martin Dietze <di...@fh-wedel.de> on 2007/06/07 20:10:47 UTC

T5: property lifecycle again

Hi,

 I want to load a page which displays a particular entry from a
database. To accomplish this I create an action link in the
parent page which causes the parent page's object to call a
method of my display-an-entry page object passing the DB-bean
as a parameter. Within that method I assign this object to a
member variable which is supposed to allow me to read and
display its data on the page.

Unfortunaetly the value of that member variable gets reset
before the page can be rendered. It seems like member vars like
this one are supposed to be initialized at a later stage within
the page's lifecycle.

Does this mean that the way I am doing it (by passing on the
object as an argument) is fundamentally wrong, or which would
be an elegant way to do this?

Cheers,

Martin

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
My name is spelled Luxury Yacht but it's pronounced Throatwabbler Mangrove.

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


Re: T5: property lifecycle again

Posted by Martin Grotzke <ma...@javakaffee.de>.
On Thu, 2007-06-07 at 21:28 +0200, Martin Dietze wrote:
> On Thu, June 07, 2007, Davor Hrg wrote:
> 
> > It's a guess, but I think that you just need to persist the property.
> > @Persist("flash")
> 
> That's what I thought, but it does not work. It seems to have
> to do with the way T5 initializes its member variables (my
> guess)... 
Can you post the relevant parts of your code to get a better
idea of what you're doing?

Cheers,
MartinG :)

> 
> Cheers,
> 
> Martin
> 


Re: T5: property lifecycle again

Posted by Martin Dietze <di...@fh-wedel.de>.
On Thu, June 07, 2007, Davor Hrg wrote:

> It's a guess, but I think that you just need to persist the property.
> @Persist("flash")

That's what I thought, but it does not work. It seems to have
to do with the way T5 initializes its member variables (my
guess)... 

Cheers,

Martin

-- 
----------- / http://herbert.the-little-red-haired-girl.org / -------------
=+= 
Hlade's Law: If you have a difficult task, give it to a lazy person;
           they will find an easier way to do it. 

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


Re: T5: property lifecycle again

Posted by Davor Hrg <hr...@gmail.com>.
It's a guess, but I think that you just need to persist the property.
@Persist("flash")

action link generate action requests, if action request does not
return a result it'self, page continues to render phase...
but this does not happen in the same request,
the page gets redirected to it self first,
so it is expected that the property is reses because it is
a completely different request.

@Persist("flash") fits jus right here, since it persists data only
for request.

Davor Hrg
On 6/7/07, Martin Dietze <di@fh-wedel.de > wrote:
>
> Hi,
>
> I want to load a page which displays a particular entry from a
> database. To accomplish this I create an action link in the
> parent page which causes the parent page's object to call a
> method of my display-an-entry page object passing the DB-bean
> as a parameter. Within that method I assign this object to a
> member variable which is supposed to allow me to read and
> display its data on the page.
>
> Unfortunaetly the value of that member variable gets reset
> before the page can be rendered. It seems like member vars like
> this one are supposed to be initialized at a later stage within
> the page's lifecycle.
>
> Does this mean that the way I am doing it (by passing on the
> object as an argument) is fundamentally wrong, or which would
> be an elegant way to do this?
>
> Cheers,
>
> Martin
>
> --
> ----------- / http://herbert.the-little-red-haired-girl.org /
> -------------
> =+=
> My name is spelled Luxury Yacht but it's pronounced Throatwabbler
> Mangrove.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>