Ok,
So this means that
private MyObject myObject = new MyObject();
would not give me a new MyObject for every request? only a reference
to that object (that was created once at page creation time)
is this correct?
this means that I would need something like this in onActivate()
if (myObject == null)
{
myObject = new MyObject();
}
2007/9/24, Josh Canfield <[EMAIL PROTECTED]>:
> It's working as specified.
>
> Tapestry automatically resets the value of your page attribute to what it
> was when the page object was first created. In this case, the value is
> whatever your method returned. It's not going to call your initialization
> method again.
>
> If you want your attribute to be different on every request then you should
> do that assignment in the onActivate or using the page lifecycle methods,
> attach/detach...
>
> Josh
>
>
> On 9/24/07, Ted Steen <[EMAIL PROTECTED]> wrote:
> >
> > Hi all,
> >
> > I define a field like this
> > private MyObject myObject = getDefaultMyObject();
> > Now, the default value is not set in the end of the request as documented.
> > If I put myObject in a form and alter fields within it, the values
> > will pop up in subsequent requests even from different clients(!).
> > This, I think, because the value is retained on the myObject field,
> > then returned to the page pool and reused later.
> >
> > Am I supposed to reset the value in the end of the request? I though
> > it was automated.
> >
> > --
> > /ted
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> --
> TheDailyTube.com. Sign up and get the best new videos on the internet
> delivered fresh to your inbox.
>
--
/ted
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]