similarly you can call the dispose() or flush() or even setVisible(false) method on the click event for the cancel button. that way the popup should close.
My Dear Loken, those Cancel, Save and Open buttons are of windows dialog box, not of any which I am creating.
Let me explain. Assume X.jsp is a page on which a link Export is present. On clickicking it, a new Pop up is opened which DOES NOT have any body. A new page called Y.jsp will be loaded on this pop up in Excel Format. In Y.jsp I am using
contentType="application/vnd.ms-excel; charset=UTF-8" in Y.jsp, that is why I cannot place any javascript code on Y.jsp.
I have attached the view of Dialog Box. If Open is pressed, Y.jsp will be loaded on EMPTY pop up, else, the pop up will be there without any body.