In the article forms-startup I wrote last year how to hide the browser-window, while starting a forms-application. Another problem is: How can we close the browser-window after exiting the forms-application. Here is my favorite solution:
1) Create a new html-file e.g. close.html in your html-directory. This is the main routine, which closes the browser-window.
< BODY onLoad="window.close();" >
2) Set the formsweb.cfg parameter
HTMLbeforeForm in the server-directory. This eliminates the security-question "Do you want to close the browser-window".
HTMLbeforeForm=< SCRIPT LANGUAGE="JavaScript" >window.opener = top;< /SCRIPT >
3) The form, which closes the main-application needs a
POST-FORM-trigger. /forms/html is a virtual-directory, which points to the close.html.
web.show_document ('/forms/html/close.html', '_self');
Used directories:
< DevSuite-Home > : Your Developer-Suite Home Directory
html-directory : < DevSuite-Home >\tools\web\html
server-directory : < DevSuite-Home >\forms\server
virtual-html-directory : /forms/html defined in forms.conf
Many thanks to
Duncan Mills,
Frank Nimphius and Richard Squires, who posted this code in the OTN years ago.
Pro) This technique works on IE 6 and IE 7, tested with JInitiator and Sun-Plugin.
Contra) No Firefox-Support. Since Firefox 2.0 it isn't allowed to close a window via JavaScript.
Important: The limitations of this blog forced me to write blanks after each "<" and before each ">". Don't write them, when you use this technique !
have fun
Gerd