Connecting Tech Pros Worldwide Help | Site Map

Results from child window submit into parent window, then child closes -- How To?

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 23rd, 2005, 05:34 PM
Spammay Blockay
Guest
 
Posts: n/a
Default Results from child window submit into parent window, then child closes -- How To?

Hi all...

I'm writing a Struts application, and one window pops up another,
non-modal, window.

What I want to do is, when the user presses a button on the child
window, I want the parent window to be the target of the server response.
And I also want the child window to close.

These windows are not frames, but fully-fledged browser windows.

Is there a relatively easy way to do this, does anyone know?

- Tim

--


  #2  
Old July 23rd, 2005, 05:34 PM
Dietmar Meier
Guest
 
Posts: n/a
Default Re: Results from child window submit into parent window, then child closes -- How To?

Spammay Blockay wrote:
[color=blue]
> What I want to do is, when the user presses a button on the child
> window, I want the parent window to be the target of the server
> response.[/color]

If that "button" is a link, use

<a href="..." onclick="if (opener && !opener.closed) {
opener.location=this.href; return false }"[color=blue]
>...</a>[/color]

If that "button" is a submit control, use

<form ... onsubmit="if (opener && !opener.closed) {
var s = "w" + new Date().getTime();
opener.name = s; this.target = s; }"[color=blue]
>[/color]
[color=blue]
> And I also want the child window to close.[/color]

Try to add "window.setTimeout('close()',100);" before the "return
false" above or after the "this.target = s;" above.

ciao, dhgm
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.