1 2 Previous Next 17 Replies Latest reply: Jun 8, 2009 9:01 AM by 49905 RSS

    Close browser window on exit

    672749
      Hi all,

      been looking around on something about closing the browser window when i exit my forms application but nothing yet.

      Have created a .html page with this code


      *<html>*
      *<body onload="closeit()">*


      *<script language="JavaScript">*


      *function closeit() {*
      win = top;
      win.opener = top;
      win.close ();

      *}*


      *</script>*
      *</body>*
      *</html>*
      have a post_form trigger with this code

      begin
      web.show_document('C:\close.html');
      end;

      browser isn't closed when i exit application.
        • 1. Re: Close browser window on exit
          user434854
          In the KEY-EXIT-Trigger insert :

          WEB.SHOW_DOCUMENT(urlstr,'_self');
          EXIT_FORM(NO_VALIDATE);

          urlstr is a string containing a http-request : http://server:port/.../close.html
          • 2. Re: Close browser window on exit
            672749
            where do i place the close.html file? and if my server is lion and port 1234,would my string be

            http:\\lion:1234\close.html
            • 3. Re: Close browser window on exit
              user434854
              Easiest way is :
              On your application server, create a directory below htdocs :

              $ORACLE_HOME/Apache/Apache/htdocs/MYAPP

              copy close.html to folder MYAPP

              http call would be :

              http://server:port/MYAPP/close.html or

              http://lion:1234/MYAPP/close.html
              • 4. Re: Close browser window on exit
                672749
                my key_exit trigger looks like this but browser window isn't closed on exit of the application


                     begin
                *     web.show_document('http://lion:7777/forms/close.html','_self');*
                *     EXIT_FORM(NO_VALIDATE);*
                *     end;*
                • 5. Re: Close browser window on exit
                  672749
                  dont have an htdocs directory. tried creating one but its not being seen. http://lion:7777 runs successfully however
                  • 6. Re: Close browser window on exit
                    90680
                    Hi Kanaa:
                    Let me try to help you a little:
                    1. Create inside your form module, a form trigger called POST-FORM, and include the following code:
                    web.show_document('/forms/webutil/closeBrowser.htm','_self');
                    2. Create the closeBrwoser.htm, and put the following code:
                    <HTML>
                    <BODY onload="closeit()">
                    <SCRIPT>
                    function closeit()
                    {
                    win = top;
                    win.opener = top;
                    win.close();
                    }
                    </SCRIPT>
                    </BODY>
                    </HTML>

                    Be sure to copy the closeBrwoser.htm in one of the virtual folder defined in the OAS Server. For example, in the code I wrote in the point number one, in my OAS I a have a virtual directory called: /forms/webutil/ and in these directory I copy the file.
                    Look at the FORMS.CONF in your OAS installation, usually these files are in: $ORACLE_HOME/forms/server

                    Do your test.
                    Best regards,

                    Abdel Miranda
                    Panama
                    • 7. Re: Close browser window on exit
                      672749
                      Thanks for you help but i have placed the closeBrowser.htm in the virtual directory /forms/webutil/..... that i can see in my forms.conf
                      However when i exit the application, i get this error message
                      The requested URL /forms/webutil/closeBrowser.htm was not found on this server.
                      What am i doing wrong
                      • 8. Re: Close browser window on exit
                        90680
                        Hi Kanaa:
                        Do a simple test to see what happend, try to write this address on your internet explorer and tell what happend:

                        http://yourhostname:portnumber/forms/webutil/closeBrowser.htm

                        Abdel Miranda
                        Panama
                        • 9. Re: Close browser window on exit
                          90680
                          Hi Kaana:
                          You can do also a simple test usign forms builder 10g.

                          Open the builder and develop a simple module with just, one button on canves.
                          Write the following code on the WHEN-BUTTON-PRESSED Trigger:
                          begin
                               web.show_document('/forms/webutil/closeBrowser.htm','_self');
                          end;

                          Run the module in your OAS and see if that works.

                          The module after pressing the button must close all your execution.
                          The same way if you write the url I gave before, the internet explorer windows must close.

                          Best regards,

                          Abdel Miranda
                          Panama
                          • 10. Re: Close browser window on exit
                            703365
                            Has anyone salved this problem?
                            Cause I have the same one.
                            But I dont have folders forms/webutil, but forms90/xx
                            But these virtual folders - we can not see them right? SO how to define to which folder has to go that htm file, if I dont even see the folders?

                            This is my whole file FORMS90.CONF:
                            # $Id: forms90.conf,v 1.4 2003/05/28 18:45:07 ahousing Exp $
                            # Name
                            # forms90.conf
                            # Purpose
                            # Apache mod_oc4j and mod_jserv configuration file for Forms 9i Services.
                            # This file should be included into the Oracle Apache HTTP Listener
                            # configuration file (typically by adding an include statement to the
                            # oracle_apache.conf file)
                            # Remarks
                            # If Forms is to be used with JServ, the jserv.properties file needs editing
                            # to add the "forms90" servlet zone with properties file forms90.properties
                            # Notes
                            # Virtual paths: We use AliasMatch when defining virtual paths for
                            # security reasons (prevents directory browsing).

                            # Virtual path mapping for Forms Java jar and class files (codebase)
                            AliasMatch ^/forms90/java/(..*) "C:\OracleSuite10g/forms90/java/$1"

                            # Virtual path for JInitiator downloadable executable and download page
                            AliasMatch ^/forms90/jinitiator/(..*) "C:\OracleSuite10g/jinit/$1"

                            # Virtual path for runform.htm (used to run a form for testing purposes)
                            AliasMatch ^/forms90/html/(..*) "C:\OracleSuite10g/tools/web90/html/$1"

                            # Configuration for JServ (if mod_jserv.c is available and not mod_oc4j.c)
                            <IfModule mod_jserv.c>
                            # Only configure for JServ if mod_oc4j is NOT available:
                            <IfModule !mod_oc4j.c>
                            # Virtual path mapping for FormsServlet and ListenerServlet.
                            # Purpose: paths to invoke the servlets should be /forms90/f90servlet
                            # and /forms90/l90servlet respectively.
                            # We map f90servlet to servlet.if90, and l90servlet to servlet.ifl90.
                            # The apJServAction directives (below) will then remap those.
                            AliasMatch ^/forms90/f90servlet(.*) "/servlet.if90"
                            AliasMatch ^/forms90/l90servlet(.*) "/servlet.ifl90"

                            ApJServMount /forms90/servlet /forms90
                            #
                            # Let the servlets be called by file extension (e.g /servlet.if90)
                            #
                            ApJServAction .if90 /forms90/servlet/f90servlet
                            ApJServAction .ifl90 /forms90/servlet/l90servlet
                            # Prevent access to the Forms Servlets by paths other than
                            # /forms90/f90servlet and /forms90/l90servlet.
                            # 1. Prevent access via the .if90 and .ifl90 file extensions:
                            <LocationMatch ^.*\.if.*90>
                            order deny,allow
                            deny from all
                            </LocationMatch>
                            # 2. Stop access by class (by paths like
                            # /forms90/servlet/oracle.forms.servlet.FormsServlet)
                            <LocationMatch ^/forms90/servlet/oracle\.forms.*>
                            order deny,allow
                            deny from all
                            </LocationMatch>
                            </IfModule>
                            </IfModule>

                            # Config. for OC4J
                            <IfModule mod_oc4j.c>
                            Oc4jMount /forms90 OC4J_BI_Forms
                            Oc4jMount /forms90/f90servlet OC4J_BI_Forms
                            Oc4jMount /forms90/f90servlet/* OC4J_BI_Forms
                            Oc4jMount /forms90/l90servlet OC4J_BI_Forms
                            Oc4jMount /forms90/l90servlet/* OC4J_BI_Forms
                            </IfModule>



                            So how can I know which folder to use from these text?
                            And btw, do I need to manually create that virtual folder? Is it in my case folder "servlet"?

                            Edited by: Mitja Bonca on 29.5.2009 15:14
                            • 11. Re: Close browser window on exit
                              703365
                              It seems it works sometihng.
                              I created a folder "forms90/f90servlet" and inside put that hml file
                              This is now what it shows when I click X for closing the main Form - PICTURE
                              And if I click OK, this picture closes, but the browser does not! Any ideas?

                              Edited by: Mitja Bonca on 29.5.2009 15:26
                              • 12. Re: Close browser window on exit
                                90680
                                Hello Mitia:

                                As I told before, it is not important where you place the closeBrowser.htm as much as the OC4J (or your iAS) see the virtual path pointing to these path.
                                I already developed a module and create a trigger named POST-FORM (Level form) and in its code I wrote a simple line just to test the closeBrowser.htm:
                                web.show_document('/forms/webutil/closeBrowser.htm','_self');

                                As you see, in my configuration file, forms.conf, i have defined a line like this:
                                # Virtual path for webutil
                                AliasMatch ^/forms/webutil/(..*) "C:\Oracle\DevSuite10g/forms/webutil/$1"

                                So this lines tells to OC4J that any file you put in it, you see it by url using the following syntax:
                                http://host:port/forms/webutil/closeBrowser.htm

                                In your case, try using
                                http://host:port/forms90/f90servletl/closeBrowser.htm (take car of the syntax of the names, is htm not nml).

                                If those works, you can replace these instruction inside your modle, as I mentioned above specifying in the web.show_document the viertual path and the htm file.

                                Hope it works

                                Abdel Miranda
                                AEMS GLobal Group
                                Panama
                                • 13. Re: Close browser window on exit
                                  49905
                                  Mitja, in your forms90.conf, there is html directory predefined during installtion
                                  # Virtual path for runform.htm (used to run a form for testing purposes)
                                  AliasMatch ^/forms90/html/(..*) "C:\OracleSuite10g/tools/web90/html/$1"
                                  You can put your close.html in C:/OracleSuite10g/tools/web90/html folder and call in

                                  POST_FORM
                                  web.show_document('/forms90/html/close.html','_self');
                                  Edited by: Slava Natapov on May 29, 2009 9:51 AM
                                  • 14. Re: Close browser window on exit
                                    703365
                                    It`s not working! I did like you said, but I got an error page!

                                    btw, what code it should be to close just the tab, not the whole running browser? Just one tab (window, on which oracle is running).
                                    If this is the code for closing whole browser:
                                    <HTML>
                                    <BODY onload="closeit()">
                                    <SCRIPT>
                                    function closeit()
                                    {
                                    win = top;
                                    win.opener = top;
                                    win.close();
                                    }
                                    </SCRIPT>
                                    </BODY>
                                    </HTML>

                                    what could be then for just a tab?
                                    1 2 Previous Next