File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes Modal window and its side-effects Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Modal window and its side-effects" Watch "Modal window and its side-effects" New topic

Modal window and its side-effects

K Aditi
Ranch Hand

Joined: Mar 17, 2008
Posts: 89
I have a jsp page from which I am opening a modal window by using showModalDialog. Through this modal window I am transferring control to a servlet where it does some database processing.
Now I want to close the modal window after servlet processing. I was able to do this by executing the following code in the servlet.

The modal window closes but the window which invoked the modal window is also getting reloaded with the modal window contents.
Any work-around for this?

What I want is, After closing/submitting the modal window, it should close automatically and the parent window should refresh.
Any help will be appreciated.

Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
Put the


line after the modal window line.

K Aditi
Ranch Hand

Joined: Mar 17, 2008
Posts: 89
Thanks Eric.It worked.
K Aditi
Ranch Hand

Joined: Mar 17, 2008
Posts: 89
Can I somehow avoid closing the modal window from the servlet?
I'd prefer doing the operation from the parent jsp.
Being pretty new to javascript and jsp/servlet can somebody provide me with a pointer to it?Thanks.
I agree. Here's the link:
subject: Modal window and its side-effects
It's not a secret anymore!