You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jeevan Bihari <je...@yahoo.com> on 2003/06/08 23:42:42 UTC

finishLoad problem

Hi,

  My web app has two pages - A and B and Page B has a browser component (copied from Vlib
example). Page A has a button that launches page B in a popup window. I need to initialize the
browser component data when page B is rendered in the popup for the first time. How can I do this
as it seems finishLoad is only called when page B is put in the pool for the first time and not in
subsequent displays of Page B. I also can't use detach to do this because when I do that the
pagination in the browse component breaks.

TIA,
Jeevan

__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: finishLoad problem

Posted by Jeevan Bihari <je...@yahoo.com>.
The second option (that is, implementing IExternalPage and activateExternalPage) worked for me.

Thanks much,
Jeevan

--- Mindbridge <mi...@yahoo.com> wrote:
> The way you would resolve this in a normal (one window situation) would be
> to have a DirectLink in the previous page, and in the listener of the Direct
> link do:
> 
>     PageToOpen page = (PageToOpen) cycle.getPage("PageToOpen");
>     // initialize PageToOpen for the first render by calling its method(s)
>     cycle.activate(page);
> 
> The fact that you want to open this page in another window is irrelevant in
> this case -- just use the same URL of the DirectLink (e.g. by passing the
> HTML arguments for opening in a new window as informal parameters to
> DirectLink, or by generating the URL using the Direct service and inserting
> it into a script).
> 
> Another approach is to use the External service -- have the the page that
> you want to open implement the IExternalPage interface and prepare the URL
> in one of the ways described above (using ExternalLink or via the Exernal
> service). When the page renders with that URL, its activateExternalPage()
> method will be invoked, and you can initialize it the way you want.
> 
> Personally, I prefer the first method, but it depends on the situation. In
> both cases, however, you can pass data from the previous page to the one you
> want to open without a problem.
> 
> 
> ----- Original Message ----- 
> From: "Jeevan Bihari" <je...@yahoo.com>
> To: <ta...@jakarta.apache.org>
> Sent: Monday, June 09, 2003 1:06 AM
> Subject: Re: finishLoad problem
> 
> 
> >   Tried pageBeginRender, pageEndRender after implementing the
> pageRenderListener. Also, tried
> > detach, validate, beginResponse etc. None of these methods seem to be
> called only once when the
> > page is displayed in the popup after the button in page A is clicked. All
> these methods are also
> > called when user interacts with the browser component in page B which is
> the problem. And
> > finishLoad is only called once when the page is put into the pool for the
> first time.
> >
> >   Basically, I'm looking for a method or mechanism that will be called
> only when the popup
> > displays Page B when the user clicks on the button in page A and not when
> user interacts with the
> > browser component on page B. I'm using JavaScript to display the popup so
> if there's a way to send
> > a message to Tapestry from JavaScript, that would be great.
> >
> > Thanks,
> > Jeevan
> >
> > --- Harish Krishnaswamy <hk...@comcast.net> wrote:
> > > I think you have to implement PageRenderListener.pageBeginRender for
> > > this. There is also a pageEndRender.
> > >
> > > -Harish
> > >
> > > Jeevan Bihari wrote:
> > >
> > > >Hi,
> > > >
> > > >  My web app has two pages - A and B and Page B has a browser component
> (copied from Vlib
> > > >example). Page A has a button that launches page B in a popup window. I
> need to initialize the
> > > >browser component data when page B is rendered in the popup for the
> first time. How can I do
> > > this
> > > >as it seems finishLoad is only called when page B is put in the pool
> for the first time and not
> > > in
> > > >subsequent displays of Page B. I also can't use detach to do this
> because when I do that the
> > > >pagination in the browse component breaks.
> > > >
> > > >TIA,
> > > >Jeevan
> > > >
> > > >__________________________________
> > > >Do you Yahoo!?
> > > >Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> > > >http://calendar.yahoo.com
> > > >
> > > >---------------------------------------------------------------------
> > > >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
> > >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> > http://calendar.yahoo.com
> >
> > ---------------------------------------------------------------------
> > 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
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: finishLoad problem

Posted by Mindbridge <mi...@yahoo.com>.
The way you would resolve this in a normal (one window situation) would be
to have a DirectLink in the previous page, and in the listener of the Direct
link do:

    PageToOpen page = (PageToOpen) cycle.getPage("PageToOpen");
    // initialize PageToOpen for the first render by calling its method(s)
    cycle.activate(page);

The fact that you want to open this page in another window is irrelevant in
this case -- just use the same URL of the DirectLink (e.g. by passing the
HTML arguments for opening in a new window as informal parameters to
DirectLink, or by generating the URL using the Direct service and inserting
it into a script).

Another approach is to use the External service -- have the the page that
you want to open implement the IExternalPage interface and prepare the URL
in one of the ways described above (using ExternalLink or via the Exernal
service). When the page renders with that URL, its activateExternalPage()
method will be invoked, and you can initialize it the way you want.

Personally, I prefer the first method, but it depends on the situation. In
both cases, however, you can pass data from the previous page to the one you
want to open without a problem.


----- Original Message ----- 
From: "Jeevan Bihari" <je...@yahoo.com>
To: <ta...@jakarta.apache.org>
Sent: Monday, June 09, 2003 1:06 AM
Subject: Re: finishLoad problem


>   Tried pageBeginRender, pageEndRender after implementing the
pageRenderListener. Also, tried
> detach, validate, beginResponse etc. None of these methods seem to be
called only once when the
> page is displayed in the popup after the button in page A is clicked. All
these methods are also
> called when user interacts with the browser component in page B which is
the problem. And
> finishLoad is only called once when the page is put into the pool for the
first time.
>
>   Basically, I'm looking for a method or mechanism that will be called
only when the popup
> displays Page B when the user clicks on the button in page A and not when
user interacts with the
> browser component on page B. I'm using JavaScript to display the popup so
if there's a way to send
> a message to Tapestry from JavaScript, that would be great.
>
> Thanks,
> Jeevan
>
> --- Harish Krishnaswamy <hk...@comcast.net> wrote:
> > I think you have to implement PageRenderListener.pageBeginRender for
> > this. There is also a pageEndRender.
> >
> > -Harish
> >
> > Jeevan Bihari wrote:
> >
> > >Hi,
> > >
> > >  My web app has two pages - A and B and Page B has a browser component
(copied from Vlib
> > >example). Page A has a button that launches page B in a popup window. I
need to initialize the
> > >browser component data when page B is rendered in the popup for the
first time. How can I do
> > this
> > >as it seems finishLoad is only called when page B is put in the pool
for the first time and not
> > in
> > >subsequent displays of Page B. I also can't use detach to do this
because when I do that the
> > >pagination in the browse component breaks.
> > >
> > >TIA,
> > >Jeevan
> > >
> > >__________________________________
> > >Do you Yahoo!?
> > >Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> > >http://calendar.yahoo.com
> > >
> > >---------------------------------------------------------------------
> > >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
> >
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: finishLoad problem

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I don't think Tapestry has anything method to handle this event. I think 
you will have to handle it from within the pageBeginRender in 
combination with a persistent page property or a session property.

-Harish

Jeevan Bihari wrote:

>  Tried pageBeginRender, pageEndRender after implementing the pageRenderListener. Also, tried
>detach, validate, beginResponse etc. None of these methods seem to be called only once when the
>page is displayed in the popup after the button in page A is clicked. All these methods are also
>called when user interacts with the browser component in page B which is the problem. And
>finishLoad is only called once when the page is put into the pool for the first time.
>
>  Basically, I'm looking for a method or mechanism that will be called only when the popup
>displays Page B when the user clicks on the button in page A and not when user interacts with the
>browser component on page B. I'm using JavaScript to display the popup so if there's a way to send
>a message to Tapestry from JavaScript, that would be great.
>
>Thanks,
>Jeevan
>
>--- Harish Krishnaswamy <hk...@comcast.net> wrote:
>  
>
>>I think you have to implement PageRenderListener.pageBeginRender for 
>>this. There is also a pageEndRender.
>>
>>-Harish
>>
>>Jeevan Bihari wrote:
>>
>>    
>>
>>>Hi,
>>>
>>> My web app has two pages - A and B and Page B has a browser component (copied from Vlib
>>>example). Page A has a button that launches page B in a popup window. I need to initialize the
>>>browser component data when page B is rendered in the popup for the first time. How can I do
>>>      
>>>
>>this
>>    
>>
>>>as it seems finishLoad is only called when page B is put in the pool for the first time and not
>>>      
>>>
>>in
>>    
>>
>>>subsequent displays of Page B. I also can't use detach to do this because when I do that the
>>>pagination in the browse component breaks.
>>>
>>>TIA,
>>>Jeevan
>>>
>>>__________________________________
>>>Do you Yahoo!?
>>>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>>>http://calendar.yahoo.com
>>>
>>>---------------------------------------------------------------------
>>>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
>>
>>    
>>
>
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>


Re: finishLoad problem

Posted by Jeevan Bihari <je...@yahoo.com>.
  Tried pageBeginRender, pageEndRender after implementing the pageRenderListener. Also, tried
detach, validate, beginResponse etc. None of these methods seem to be called only once when the
page is displayed in the popup after the button in page A is clicked. All these methods are also
called when user interacts with the browser component in page B which is the problem. And
finishLoad is only called once when the page is put into the pool for the first time.

  Basically, I'm looking for a method or mechanism that will be called only when the popup
displays Page B when the user clicks on the button in page A and not when user interacts with the
browser component on page B. I'm using JavaScript to display the popup so if there's a way to send
a message to Tapestry from JavaScript, that would be great.

Thanks,
Jeevan

--- Harish Krishnaswamy <hk...@comcast.net> wrote:
> I think you have to implement PageRenderListener.pageBeginRender for 
> this. There is also a pageEndRender.
> 
> -Harish
> 
> Jeevan Bihari wrote:
> 
> >Hi,
> >
> >  My web app has two pages - A and B and Page B has a browser component (copied from Vlib
> >example). Page A has a button that launches page B in a popup window. I need to initialize the
> >browser component data when page B is rendered in the popup for the first time. How can I do
> this
> >as it seems finishLoad is only called when page B is put in the pool for the first time and not
> in
> >subsequent displays of Page B. I also can't use detach to do this because when I do that the
> >pagination in the browse component breaks.
> >
> >TIA,
> >Jeevan
> >
> >__________________________________
> >Do you Yahoo!?
> >Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> >http://calendar.yahoo.com
> >
> >---------------------------------------------------------------------
> >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
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: finishLoad problem

Posted by Harish Krishnaswamy <hk...@comcast.net>.
I think you have to implement PageRenderListener.pageBeginRender for 
this. There is also a pageEndRender.

-Harish

Jeevan Bihari wrote:

>Hi,
>
>  My web app has two pages - A and B and Page B has a browser component (copied from Vlib
>example). Page A has a button that launches page B in a popup window. I need to initialize the
>browser component data when page B is rendered in the popup for the first time. How can I do this
>as it seems finishLoad is only called when page B is put in the pool for the first time and not in
>subsequent displays of Page B. I also can't use detach to do this because when I do that the
>pagination in the browse component breaks.
>
>TIA,
>Jeevan
>
>__________________________________
>Do you Yahoo!?
>Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
>http://calendar.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>  
>