You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Eric Schneider <er...@centralparksoftware.com> on 2003/10/23 20:52:45 UTC

Tapestry 2.3/ pageDetached() never called?

Hi,

Quick question on component property cleanup.  I have a component that
derives an instance variable from a cookie.   The component contains a
stateless form that sets values on the instance variable, and inturn sets it
on another page.  The problem that is occuring is that the instance
variables on the component are never detached after the action method is
invoked.

There is a detach() method in the Page's .java file.  The component's .java
file implements PageDetachListener, and contains a pageDetached() method
which seems to never be invoked.

I'm I missing a step here?   Is there something else I need to do on the
Page side to ensure that the component detaches it's variables?

Thanks in advance,
Eric

PS. The application is stateless....though, I'm not sure that has anything
to do with what's happening.


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


Re: Tapestry 2.3/ pageDetached() never called?

Posted by Eric Schneider <er...@centralparksoftware.com>.
Yup, that's it.  Thanks Howard, Harish.

Cheers,
e.

----- Original Message ----- 
From: "Eric Schneider" <er...@centralparksoftware.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, October 23, 2003 4:20 PM
Subject: Re: Tapestry 2.3/ pageDetached() never called?


> Do i just need to add:
>
> getPage().addPageDetachListener(this);
>
> in my finshedLoad() method?
>
> e.
>
> ----- Original Message ----- 
> From: "Eric Schneider" <er...@centralparksoftware.com>
> To: "Tapestry users" <ta...@jakarta.apache.org>
> Sent: Thursday, October 23, 2003 4:15 PM
> Subject: Re: Tapestry 2.3/ pageDetached() never called?
>
>
> > Howard,
> >
> > > In 2.3 you have to have your component register itself with the page
as
> a
> > listener, usually from
> > > finishLoad().
> >
> > Thanks, but how would a component register itself with a page as a
> listener?
> > I just need a little more of a hint.
> >
> > I implement a finishLoad() method in my component, correct?  What do I
do
> > after that?  Nothing is jumping out at me.
> >
> > public void finishLoad(IRequestCycle cycle, IPageLoader loader,
> > ComponentSpecification specification)
> >   throws PageLoaderException {
> >
> >
> >  super.finishLoad(cycle, loader, specification);
> > }
> >
> > Thanks,
> > e.
> >
> > ----- Original Message ----- 
> > From: "Howard M. Lewis Ship" <hl...@comcast.net>
> > To: "'Tapestry users'" <ta...@jakarta.apache.org>
> > Sent: Thursday, October 23, 2003 3:56 PM
> > Subject: RE: Tapestry 2.3/ pageDetached() never called?
> >
> >
> > > In 2.3 you have to have your component register itself with the page
as
> a
> > listener, usually from
> > > finishLoad().
> > >
> > > In 3.0, the component automatically registers itself (if it implements
> the
> > right interface).
> > >
> > > --
> > > Howard M. Lewis Ship
> > > Creator, Tapestry: Java Web Components
> > > http://jakarta.apache.org/tapestry
> > > http://jakarta.apache.org/commons/sandbox/hivemind/
> > > http://javatapestry.blogspot.com
> > >
> > > > -----Original Message-----
> > > > From: Eric Schneider [mailto:eric@centralparksoftware.com]
> > > > Sent: Thursday, October 23, 2003 2:53 PM
> > > > To: Tapestry users
> > > > Subject: Tapestry 2.3/ pageDetached() never called?
> > > >
> > > >
> > > > Hi,
> > > >
> > > > Quick question on component property cleanup.  I have a component
that
> > > > derives an instance variable from a cookie.   The component contains
a
> > > > stateless form that sets values on the instance variable, and
> > > > inturn sets it on another page.  The problem that is occuring
> > > > is that the instance variables on the component are never
> > > > detached after the action method is invoked.
> > > >
> > > > There is a detach() method in the Page's .java file.  The
> > > > component's .java file implements PageDetachListener, and
> > > > contains a pageDetached() method which seems to never be invoked.
> > > >
> > > > I'm I missing a step here?   Is there something else I need
> > > > to do on the
> > > > Page side to ensure that the component detaches it's variables?
> > > >
> > > > Thanks in advance,
> > > > Eric
> > > >
> > > > PS. The application is stateless....though, I'm not sure that
> > > > has anything to do with what's happening.
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > 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: Tapestry 2.3/ pageDetached() never called?

Posted by Eric Schneider <er...@centralparksoftware.com>.
Do i just need to add:

getPage().addPageDetachListener(this);

in my finshedLoad() method?

e.

----- Original Message ----- 
From: "Eric Schneider" <er...@centralparksoftware.com>
To: "Tapestry users" <ta...@jakarta.apache.org>
Sent: Thursday, October 23, 2003 4:15 PM
Subject: Re: Tapestry 2.3/ pageDetached() never called?


> Howard,
>
> > In 2.3 you have to have your component register itself with the page as
a
> listener, usually from
> > finishLoad().
>
> Thanks, but how would a component register itself with a page as a
listener?
> I just need a little more of a hint.
>
> I implement a finishLoad() method in my component, correct?  What do I do
> after that?  Nothing is jumping out at me.
>
> public void finishLoad(IRequestCycle cycle, IPageLoader loader,
> ComponentSpecification specification)
>   throws PageLoaderException {
>
>
>  super.finishLoad(cycle, loader, specification);
> }
>
> Thanks,
> e.
>
> ----- Original Message ----- 
> From: "Howard M. Lewis Ship" <hl...@comcast.net>
> To: "'Tapestry users'" <ta...@jakarta.apache.org>
> Sent: Thursday, October 23, 2003 3:56 PM
> Subject: RE: Tapestry 2.3/ pageDetached() never called?
>
>
> > In 2.3 you have to have your component register itself with the page as
a
> listener, usually from
> > finishLoad().
> >
> > In 3.0, the component automatically registers itself (if it implements
the
> right interface).
> >
> > --
> > Howard M. Lewis Ship
> > Creator, Tapestry: Java Web Components
> > http://jakarta.apache.org/tapestry
> > http://jakarta.apache.org/commons/sandbox/hivemind/
> > http://javatapestry.blogspot.com
> >
> > > -----Original Message-----
> > > From: Eric Schneider [mailto:eric@centralparksoftware.com]
> > > Sent: Thursday, October 23, 2003 2:53 PM
> > > To: Tapestry users
> > > Subject: Tapestry 2.3/ pageDetached() never called?
> > >
> > >
> > > Hi,
> > >
> > > Quick question on component property cleanup.  I have a component that
> > > derives an instance variable from a cookie.   The component contains a
> > > stateless form that sets values on the instance variable, and
> > > inturn sets it on another page.  The problem that is occuring
> > > is that the instance variables on the component are never
> > > detached after the action method is invoked.
> > >
> > > There is a detach() method in the Page's .java file.  The
> > > component's .java file implements PageDetachListener, and
> > > contains a pageDetached() method which seems to never be invoked.
> > >
> > > I'm I missing a step here?   Is there something else I need
> > > to do on the
> > > Page side to ensure that the component detaches it's variables?
> > >
> > > Thanks in advance,
> > > Eric
> > >
> > > PS. The application is stateless....though, I'm not sure that
> > > has anything to do with what's happening.
> > >
> > >
> > > ---------------------------------------------------------------------
> > > 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: Tapestry 2.3/ pageDetached() never called?

Posted by Harish Krishnaswamy <hk...@comcast.net>.
There is a addPageDetachListener(PageDetachListener) in AbstractPage 
that you can call I guess.

-Harish

Eric Schneider wrote:

>Howard,
>
>  
>
>>In 2.3 you have to have your component register itself with the page as a
>>    
>>
>listener, usually from
>  
>
>>finishLoad().
>>    
>>
>
>Thanks, but how would a component register itself with a page as a listener?
>I just need a little more of a hint.
>
>I implement a finishLoad() method in my component, correct?  What do I do
>after that?  Nothing is jumping out at me.
>
>public void finishLoad(IRequestCycle cycle, IPageLoader loader,
>ComponentSpecification specification)
>  throws PageLoaderException {
>
>
> super.finishLoad(cycle, loader, specification);
>}
>
>Thanks,
>e.
>
>----- Original Message ----- 
>From: "Howard M. Lewis Ship" <hl...@comcast.net>
>To: "'Tapestry users'" <ta...@jakarta.apache.org>
>Sent: Thursday, October 23, 2003 3:56 PM
>Subject: RE: Tapestry 2.3/ pageDetached() never called?
>
>
>  
>
>>In 2.3 you have to have your component register itself with the page as a
>>    
>>
>listener, usually from
>  
>
>>finishLoad().
>>
>>In 3.0, the component automatically registers itself (if it implements the
>>    
>>
>right interface).
>  
>
>>--
>>Howard M. Lewis Ship
>>Creator, Tapestry: Java Web Components
>>http://jakarta.apache.org/tapestry
>>http://jakarta.apache.org/commons/sandbox/hivemind/
>>http://javatapestry.blogspot.com
>>
>>    
>>
>>>-----Original Message-----
>>>From: Eric Schneider [mailto:eric@centralparksoftware.com]
>>>Sent: Thursday, October 23, 2003 2:53 PM
>>>To: Tapestry users
>>>Subject: Tapestry 2.3/ pageDetached() never called?
>>>
>>>
>>>Hi,
>>>
>>>Quick question on component property cleanup.  I have a component that
>>>derives an instance variable from a cookie.   The component contains a
>>>stateless form that sets values on the instance variable, and
>>>inturn sets it on another page.  The problem that is occuring
>>>is that the instance variables on the component are never
>>>detached after the action method is invoked.
>>>
>>>There is a detach() method in the Page's .java file.  The
>>>component's .java file implements PageDetachListener, and
>>>contains a pageDetached() method which seems to never be invoked.
>>>
>>>I'm I missing a step here?   Is there something else I need
>>>to do on the
>>>Page side to ensure that the component detaches it's variables?
>>>
>>>Thanks in advance,
>>>Eric
>>>
>>>PS. The application is stateless....though, I'm not sure that
>>>has anything to do with what's happening.
>>>
>>>
>>>---------------------------------------------------------------------
>>>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: Tapestry 2.3/ pageDetached() never called?

Posted by Eric Schneider <er...@centralparksoftware.com>.
Howard,

> In 2.3 you have to have your component register itself with the page as a
listener, usually from
> finishLoad().

Thanks, but how would a component register itself with a page as a listener?
I just need a little more of a hint.

I implement a finishLoad() method in my component, correct?  What do I do
after that?  Nothing is jumping out at me.

public void finishLoad(IRequestCycle cycle, IPageLoader loader,
ComponentSpecification specification)
  throws PageLoaderException {


 super.finishLoad(cycle, loader, specification);
}

Thanks,
e.

----- Original Message ----- 
From: "Howard M. Lewis Ship" <hl...@comcast.net>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Thursday, October 23, 2003 3:56 PM
Subject: RE: Tapestry 2.3/ pageDetached() never called?


> In 2.3 you have to have your component register itself with the page as a
listener, usually from
> finishLoad().
>
> In 3.0, the component automatically registers itself (if it implements the
right interface).
>
> --
> Howard M. Lewis Ship
> Creator, Tapestry: Java Web Components
> http://jakarta.apache.org/tapestry
> http://jakarta.apache.org/commons/sandbox/hivemind/
> http://javatapestry.blogspot.com
>
> > -----Original Message-----
> > From: Eric Schneider [mailto:eric@centralparksoftware.com]
> > Sent: Thursday, October 23, 2003 2:53 PM
> > To: Tapestry users
> > Subject: Tapestry 2.3/ pageDetached() never called?
> >
> >
> > Hi,
> >
> > Quick question on component property cleanup.  I have a component that
> > derives an instance variable from a cookie.   The component contains a
> > stateless form that sets values on the instance variable, and
> > inturn sets it on another page.  The problem that is occuring
> > is that the instance variables on the component are never
> > detached after the action method is invoked.
> >
> > There is a detach() method in the Page's .java file.  The
> > component's .java file implements PageDetachListener, and
> > contains a pageDetached() method which seems to never be invoked.
> >
> > I'm I missing a step here?   Is there something else I need
> > to do on the
> > Page side to ensure that the component detaches it's variables?
> >
> > Thanks in advance,
> > Eric
> >
> > PS. The application is stateless....though, I'm not sure that
> > has anything to do with what's happening.
> >
> >
> > ---------------------------------------------------------------------
> > 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: Tapestry 2.3/ pageDetached() never called?

Posted by "Howard M. Lewis Ship" <hl...@comcast.net>.
In 2.3 you have to have your component register itself with the page as a listener, usually from
finishLoad().

In 3.0, the component automatically registers itself (if it implements the right interface).

--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry
http://jakarta.apache.org/commons/sandbox/hivemind/
http://javatapestry.blogspot.com

> -----Original Message-----
> From: Eric Schneider [mailto:eric@centralparksoftware.com] 
> Sent: Thursday, October 23, 2003 2:53 PM
> To: Tapestry users
> Subject: Tapestry 2.3/ pageDetached() never called?
> 
> 
> Hi,
> 
> Quick question on component property cleanup.  I have a component that
> derives an instance variable from a cookie.   The component contains a
> stateless form that sets values on the instance variable, and 
> inturn sets it on another page.  The problem that is occuring 
> is that the instance variables on the component are never 
> detached after the action method is invoked.
> 
> There is a detach() method in the Page's .java file.  The 
> component's .java file implements PageDetachListener, and 
> contains a pageDetached() method which seems to never be invoked.
> 
> I'm I missing a step here?   Is there something else I need 
> to do on the
> Page side to ensure that the component detaches it's variables?
> 
> Thanks in advance,
> Eric
> 
> PS. The application is stateless....though, I'm not sure that 
> has anything to do with what's happening.
> 
> 
> ---------------------------------------------------------------------
> 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