You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "Francisco Figueiredo Jr." <fx...@yahoo.com.br> on 2003/04/26 18:02:29 UTC

Opening a child window have it changing the parent window state.

Hi all.
I'm working in a project where there is a requirement to open a popup window
where user will do some search. When the user receives the search results in
the popup window, it will click on one result (or select it) and so the popup
is closed and the values of the selected item is show in the parent window.

I don't know how to do this with tapestry. Do I have to work with javascript by
hand or is there some component in tapestry or something else I can do?

I thought at first in doing something which wouldn't need to refresh the parent
window. But if it can be easily done refreshing the parent window it would help
too.

I'm using tapestry 2.2.


Also, I'd like to suggest one thing:
I think it would be of great value for tapestry users to have a section in docs
talking about some common usage patterns with tapestry.
I mean, this case I'm talking about is a very good example. It would be very
much appreciated if I could go to tapestry docs page and have a section titled:
How to create popup windows 
How to work with transfer objects(value objects) pattern in a J2EE environment.
etc etc.

I think I'm not the only guy wanting to create a popup window with tapestry and
this can already have done in many different ways. With the usage patterns,
there would be a place where a person would get a good and tested example to
achieve what she wants.

Also, it would help share experiences other users have to solve common
problems.


Thanks in advance.


=====
Regards,
Francisco Figueiredo Jr.
---
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

_______________________________________________________________________
Yahoo! Mail
O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam. 
http://br.mail.yahoo.com/

RE: Opening a child window have it changing the parent window state.

Posted by "Francisco Figueiredo Jr." <fx...@yahoo.com.br>.
 --- "Howard M. Lewis Ship" <hl...@attbi.com> escreveu: 
> That's much more of a JavaScript issue than a Tapestry issue.
> 
Yes.

> I would appraoch it as so:
> 
> In the parent page, add JavaScript (using a Script component), something
> like:
> 
> function update_from_child_window(value)
> {
>   document.Form0.mYField.value = value;
> }
> 
> 
> In the child page, have JavaScript like:
> 
> window.opener.update_from_child_window(updateValue);
> window.close();
> 
> 
> 

Thanks for your fast reply Howard!

Uhmmm I think I didn't give much attention to Script component :)
I liked very much the dynamic way I could create my scripts with the
${expression} construction.

What could I pass as an informal parameter to script saying what page I would
like to open? I mean, I know I could pass a hardcoded string, but I would like
Tapestry complete it for me, maybe I wanna pass some parameters when opening
the page.
I know I would use the Page service. Could I just pass the component id of my
PageLink component as an informal parameter to script component?
If so, could I just use the javascript code:

window.open(${page}) or is there some property of the page I should get to
script create the correct string to open?

Thanks in advance.




=====
Regards,
Francisco Figueiredo Jr.
---
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
- Indira Gandhi

_______________________________________________________________________
Yahoo! Mail
O melhor e-mail gratuito da internet: 6MB de espaço, antivírus, acesso POP3, filtro contra spam. 
http://br.mail.yahoo.com/

RE: Opening a child window have it changing the parent window state.

Posted by "Howard M. Lewis Ship" <hl...@attbi.com>.
That's much more of a JavaScript issue than a Tapestry issue.

I would appraoch it as so:

In the parent page, add JavaScript (using a Script component), something
like:

function update_from_child_window(value)
{
  document.Form0.mYField.value = value;
}


In the child page, have JavaScript like:

window.opener.update_from_child_window(updateValue);
window.close();



--
Howard M. Lewis Ship
Creator, Tapestry: Java Web Components
http://jakarta.apache.org/tapestry



> -----Original Message-----
> From: Francisco Figueiredo Jr. [mailto:fxjrlists@yahoo.com.br] 
> Sent: Saturday, April 26, 2003 12:02 PM
> To: tapestry-user@jakarta.apache.org
> Subject: Opening a child window have it changing the parent 
> window state.
> 
> 
> 
> Hi all.
> I'm working in a project where there is a requirement to open 
> a popup window where user will do some search. When the user 
> receives the search results in the popup window, it will 
> click on one result (or select it) and so the popup is closed 
> and the values of the selected item is show in the parent window.
> 
> I don't know how to do this with tapestry. Do I have to work 
> with javascript by hand or is there some component in 
> tapestry or something else I can do?
> 
> I thought at first in doing something which wouldn't need to 
> refresh the parent window. But if it can be easily done 
> refreshing the parent window it would help too.
> 
> I'm using tapestry 2.2.
> 
> 
> Also, I'd like to suggest one thing:
> I think it would be of great value for tapestry users to have 
> a section in docs talking about some common usage patterns 
> with tapestry. I mean, this case I'm talking about is a very 
> good example. It would be very much appreciated if I could go 
> to tapestry docs page and have a section titled: How to 
> create popup windows 
> How to work with transfer objects(value objects) pattern in a 
> J2EE environment. etc etc.
> 
> I think I'm not the only guy wanting to create a popup window 
> with tapestry and this can already have done in many 
> different ways. With the usage patterns, there would be a 
> place where a person would get a good and tested example to 
> achieve what she wants.
> 
> Also, it would help share experiences other users have to 
> solve common problems.
> 
> 
> Thanks in advance.
> 
> 
> =====
> Regards,
> Francisco Figueiredo Jr.
> ---
> "My grandfather once told me that there are two kinds of 
> people: those who work and those who take the credit. He told 
> me to try to be in the first group; there was less competition there."
> - Indira Gandhi
> 
> ______________________________________________________________
> _________
> Yahoo! Mail
> O melhor e-mail gratuito da internet: 6MB de espaço, 
> antivírus, acesso POP3, filtro contra spam. 
> http://br.mail.yahoo.com/
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>