I do this with client side code all the time.

The form in the popup looks like:

<FORM name="MyForm"
action="$link.setPage("Saving.vm").setAction("MyAction")" method="post">

Saving.vm looks like:

$page.addAttribute("onLoad", "reloadOpener();")
<SCRIPT>
function reloadOpener()
{
    var main = cleanURL(opener.location.href);
    opener.location.href = main;
    close();
}
</script>

<h4>Saving data. Please wait...</h4>


[ cleanURL() strips off some stuff from the originating window's URL such as
login action stuff which I don't want repeated ]

By doing it this way the popup window won't close on the off chance there is
a Turbine error. That way any error messages can be read.

There's nothing "tricky" here so it should work 100% of the time.

Blair


----- Original Message -----
From: "Naga Pappireddi" <[EMAIL PROTECTED]>
To: "Turbine Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, May 21, 2002 2:17 PM
Subject: Any out of box services for closing popup window


> Folks,
>
> I am using JSP under TDK. I have displayed a typical JSP I want to popup a
> new window in response to a click in the parent window. I want to accept
> data from user into this popup window and  close it automatically after I
> submit the data. The submitted data gets refreshed into parent window.
>
> We tried client side javascript tricks like form.submit,time delay, window
> close. It works most of the times. But as you can see there is no
guarentee
> it works all times for all browsers.
> The typical problems I face and potentially face are:
> a) The window gets closed before the form submission
> b) The parent window may be refreshed too soon before the form action had
> chance to process data
>
> As a result, the client side javascript solution to form submit, close,
> refresh parent is not reliable.
>
> I am exploring the server sending msg to close window. Before I do that, I
> want to know if there is any builtin template/screen API's available under
> TDK.
>
> Steps are:
>
> 1) Display Parent JSP
> 2) When the user clicks on a link in parent screen popup a window Using
> Javascript
> 3) When the user enters data, hit submit in child window, the child window
> should submit data and gets closed
> 4) Parent window needs to be reloaded so that it picks up the new data
> entered in child window
>
> I am looking for server side solution
>
> Thank you
>
> Naga
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to