Connecting Tech Pros Worldwide Forums | Help | Site Map

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

Spammay Blockay
Guest
 
Posts: n/a
#1: Jul 23 '05
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

--


Dietmar Meier
Guest
 
Posts: n/a
#2: Jul 23 '05

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
Closed Thread