You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Pickerel Yee <pi...@gmail.com> on 2005/09/22 04:38:36 UTC
how to init a property in the code?
i define a property in the page specification as blow:
<property name="referItem" initial-value="new
d2m.adds.model.ReferItem()"/>
everything is ok.
but when i remove the init of referItem into the page code as below :
<property name="referItem"/>
and in the page code:
public void prepareForRender(IRequestCycle cycle)
{
if (!cycle.isRewinding())
{
this.setReferItem(new d2m.adds.model.ReferItem());
}
}
it'ok when i do the first visit, but when do a submit, i got a null
point excepion that's tell me referItem is null. i don't know why,
anyone can tell me is a bug or i do something wrong with it?
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Ron Piterman <rp...@gmx.net>.
According to the docu (don't ask me where), all transient members are
set to null by tapestry before returning a page to the pool.
I remember having problems with that, but this the official behaiviour...
Cheers,
Ron
ציטוט Patrick Casey:
> *boggle*
>
> How am I supposed to reset the contents of a page before it goes
> back into the pool then?
>
> --- Pat
>
>
>>-----Original Message-----
>>From: Pickerel Yee [mailto:pickerel@gmail.com]
>>Sent: Wednesday, September 21, 2005 8:01 PM
>>To: Tapestry users
>>Subject: Re: how to init a property in the code?
>>
>>thank the reply. but "initialize" has been deprecated in the tapestry 4
>>beta 7.
>>
>>Patrick Casey wrote:
>>
>>
>>> Try using the "initialize" method.
>>>
>>> --- pat
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Pickerel Yee [mailto:pickerel@gmail.com]
>>>>Sent: Wednesday, September 21, 2005 7:39 PM
>>>>To: tapestry-user@jakarta.apache.org
>>>>Subject: how to init a property in the code?
>>>>
>>>>i define a property in the page specification as blow:
>>>> <property name="referItem" initial-value="new
>>>>d2m.adds.model.ReferItem()"/>
>>>>everything is ok.
>>>>
>>>>but when i remove the init of referItem into the page code as below :
>>>> <property name="referItem"/>
>>>>and in the page code:
>>>> public void prepareForRender(IRequestCycle cycle)
>>>> {
>>>> if (!cycle.isRewinding())
>>>> {
>>>> this.setReferItem(new d2m.adds.model.ReferItem());
>>>> }
>>>> }
>>>>
>>>>it'ok when i do the first visit, but when do a submit, i got a null
>>>>point excepion that's tell me referItem is null. i don't know why,
>>>>anyone can tell me is a bug or i do something wrong with it?
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Dan Adams <da...@ifactory.com>.
is there an equivilent for components?
On Thu, 2005-09-22 at 15:40 +0300, Ron Piterman wrote:
> implement PageDetachListener
>
<ציטוט Patrick Casey:
> > *boggle*
> >
> > How am I supposed to reset the contents of a page before it goes
> > back into the pool then?
> >
> > --- Pat
> >
> >
> >>-----Original Message-----
> >>From: Pickerel Yee [mailto:pickerel@gmail.com]
> >>Sent: Wednesday, September 21, 2005 8:01 PM
> >>To: Tapestry users
> >>Subject: Re: how to init a property in the code?
> >>
> >>thank the reply. but "initialize" has been deprecated in the tapestry 4
> >>beta 7.
> >>
> >>Patrick Casey wrote:
> >>
> >>
> >>> Try using the "initialize" method.
> >>>
> >>> --- pat
> >>>
> >>>
> >>>
> >>>
> >>>>-----Original Message-----
> >>>>From: Pickerel Yee [mailto:pickerel@gmail.com]
> >>>>Sent: Wednesday, September 21, 2005 7:39 PM
> >>>>To: tapestry-user@jakarta.apache.org
> >>>>Subject: how to init a property in the code?
> >>>>
> >>>>i define a property in the page specification as blow:
> >>>> <property name="referItem" initial-value="new
> >>>>d2m.adds.model.ReferItem()"/>
> >>>>everything is ok.
> >>>>
> >>>>but when i remove the init of referItem into the page code as below :
> >>>> <property name="referItem"/>
> >>>>and in the page code:
> >>>> public void prepareForRender(IRequestCycle cycle)
> >>>> {
> >>>> if (!cycle.isRewinding())
> >>>> {
> >>>> this.setReferItem(new d2m.adds.model.ReferItem());
> >>>> }
> >>>> }
> >>>>
> >>>>it'ok when i do the first visit, but when do a submit, i got a null
> >>>>point excepion that's tell me referItem is null. i don't know why,
> >>>>anyone can tell me is a bug or i do something wrong with it?
> >>>>
> >>>>---------------------------------------------------------------------
> >>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>>
> >>>>
> >>>
> >>>
> >>>
> >>>
> >>>---------------------------------------------------------------------
> >>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
--
Dan Adams
Software Engineer
Interactive Factory
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Peter Ertl <pe...@gmx.org>.
you should set _and_ reset it. otherwise a different thread
could accidentially use your property value. also
objects connected to your properties will not be garbage
collected (for example a string-property).
regards
Peter
> --- Ursprüngliche Nachricht ---
> Von: Dan Adams <da...@ifactory.com>
> An: Tapestry users <ta...@jakarta.apache.org>
> Betreff: Re: how to init a property in the code?
> Datum: Thu, 22 Sep 2005 09:39:27 -0400
>
> what about implementing PageAttachListener? would that be more
> appropriate if all you want to do is set your properties before
> rendering?
>
> On Thu, 2005-09-22 at 15:40 +0300, Ron Piterman wrote:
> > implement PageDetachListener
> >
> <ציטוט Patrick Casey:
> > > *boggle*
> > >
> > > How am I supposed to reset the contents of a page before it goes
> > > back into the pool then?
> > >
> > > --- Pat
> > >
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Dan Adams <da...@ifactory.com>.
what about implementing PageAttachListener? would that be more
appropriate if all you want to do is set your properties before
rendering?
On Thu, 2005-09-22 at 15:40 +0300, Ron Piterman wrote:
> implement PageDetachListener
>
<ציטוט Patrick Casey:
> > *boggle*
> >
> > How am I supposed to reset the contents of a page before it goes
> > back into the pool then?
> >
> > --- Pat
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Ron Piterman <rp...@gmx.net>.
implement PageDetachListener
ציטוט Patrick Casey:
> *boggle*
>
> How am I supposed to reset the contents of a page before it goes
> back into the pool then?
>
> --- Pat
>
>
>>-----Original Message-----
>>From: Pickerel Yee [mailto:pickerel@gmail.com]
>>Sent: Wednesday, September 21, 2005 8:01 PM
>>To: Tapestry users
>>Subject: Re: how to init a property in the code?
>>
>>thank the reply. but "initialize" has been deprecated in the tapestry 4
>>beta 7.
>>
>>Patrick Casey wrote:
>>
>>
>>> Try using the "initialize" method.
>>>
>>> --- pat
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: Pickerel Yee [mailto:pickerel@gmail.com]
>>>>Sent: Wednesday, September 21, 2005 7:39 PM
>>>>To: tapestry-user@jakarta.apache.org
>>>>Subject: how to init a property in the code?
>>>>
>>>>i define a property in the page specification as blow:
>>>> <property name="referItem" initial-value="new
>>>>d2m.adds.model.ReferItem()"/>
>>>>everything is ok.
>>>>
>>>>but when i remove the init of referItem into the page code as below :
>>>> <property name="referItem"/>
>>>>and in the page code:
>>>> public void prepareForRender(IRequestCycle cycle)
>>>> {
>>>> if (!cycle.isRewinding())
>>>> {
>>>> this.setReferItem(new d2m.adds.model.ReferItem());
>>>> }
>>>> }
>>>>
>>>>it'ok when i do the first visit, but when do a submit, i got a null
>>>>point excepion that's tell me referItem is null. i don't know why,
>>>>anyone can tell me is a bug or i do something wrong with it?
>>>>
>>>>---------------------------------------------------------------------
>>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>>
>>>>
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>>
>>>
>>>
>>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: how to init a property in the code?
Posted by Patrick Casey <pa...@adelphia.net>.
*boggle*
How am I supposed to reset the contents of a page before it goes
back into the pool then?
--- Pat
> -----Original Message-----
> From: Pickerel Yee [mailto:pickerel@gmail.com]
> Sent: Wednesday, September 21, 2005 8:01 PM
> To: Tapestry users
> Subject: Re: how to init a property in the code?
>
> thank the reply. but "initialize" has been deprecated in the tapestry 4
> beta 7.
>
> Patrick Casey wrote:
>
> > Try using the "initialize" method.
> >
> > --- pat
> >
> >
> >
> >>-----Original Message-----
> >>From: Pickerel Yee [mailto:pickerel@gmail.com]
> >>Sent: Wednesday, September 21, 2005 7:39 PM
> >>To: tapestry-user@jakarta.apache.org
> >>Subject: how to init a property in the code?
> >>
> >>i define a property in the page specification as blow:
> >> <property name="referItem" initial-value="new
> >>d2m.adds.model.ReferItem()"/>
> >>everything is ok.
> >>
> >>but when i remove the init of referItem into the page code as below :
> >> <property name="referItem"/>
> >>and in the page code:
> >> public void prepareForRender(IRequestCycle cycle)
> >> {
> >> if (!cycle.isRewinding())
> >> {
> >> this.setReferItem(new d2m.adds.model.ReferItem());
> >> }
> >> }
> >>
> >>it'ok when i do the first visit, but when do a submit, i got a null
> >>point excepion that's tell me referItem is null. i don't know why,
> >>anyone can tell me is a bug or i do something wrong with it?
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: how to init a property in the code?
Posted by Pickerel Yee <pi...@gmail.com>.
thank the reply. but "initialize" has been deprecated in the tapestry 4
beta 7.
Patrick Casey wrote:
> Try using the "initialize" method.
>
> --- pat
>
>
>
>>-----Original Message-----
>>From: Pickerel Yee [mailto:pickerel@gmail.com]
>>Sent: Wednesday, September 21, 2005 7:39 PM
>>To: tapestry-user@jakarta.apache.org
>>Subject: how to init a property in the code?
>>
>>i define a property in the page specification as blow:
>> <property name="referItem" initial-value="new
>>d2m.adds.model.ReferItem()"/>
>>everything is ok.
>>
>>but when i remove the init of referItem into the page code as below :
>> <property name="referItem"/>
>>and in the page code:
>> public void prepareForRender(IRequestCycle cycle)
>> {
>> if (!cycle.isRewinding())
>> {
>> this.setReferItem(new d2m.adds.model.ReferItem());
>> }
>> }
>>
>>it'ok when i do the first visit, but when do a submit, i got a null
>>point excepion that's tell me referItem is null. i don't know why,
>>anyone can tell me is a bug or i do something wrong with it?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: how to init a property in the code?
Posted by Patrick Casey <pa...@adelphia.net>.
Try using the "initialize" method.
--- pat
> -----Original Message-----
> From: Pickerel Yee [mailto:pickerel@gmail.com]
> Sent: Wednesday, September 21, 2005 7:39 PM
> To: tapestry-user@jakarta.apache.org
> Subject: how to init a property in the code?
>
> i define a property in the page specification as blow:
> <property name="referItem" initial-value="new
> d2m.adds.model.ReferItem()"/>
> everything is ok.
>
> but when i remove the init of referItem into the page code as below :
> <property name="referItem"/>
> and in the page code:
> public void prepareForRender(IRequestCycle cycle)
> {
> if (!cycle.isRewinding())
> {
> this.setReferItem(new d2m.adds.model.ReferItem());
> }
> }
>
> it'ok when i do the first visit, but when do a submit, i got a null
> point excepion that's tell me referItem is null. i don't know why,
> anyone can tell me is a bug or i do something wrong with it?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org