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

G

Guest

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

--
 
D

Dietmar Meier

Spammay said:
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.

If that "button" is a link, use

<a href="..." onclick="if (opener && !opener.closed) {
opener.location=this.href; return false }"

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; }"
And I also want the child window to close.

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

ciao, dhgm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top