Date:  10/17/2002 07:59:46 PM Msg ID:  000935
From:  FoxWeb Support Thread:  000929
Subject:  Re: How Do I Automatically Close A Window
FoxWeb is a server side application server and as such cannot provide tools that will help you control browser windows on the client.  Your only tool in this case is JavaScript.
 
Note that the security message will not come up if you try to close a window that was opened with the window.open method.  This is why we can open and close FoxWeb Forum windows (setup screen, message editor, etc.) without the message popping up.
 
The problem in your case is that you are trying to close an original browser window (one that was manually started by the user).  If you could modify your application run in a new window (sort of like the Forum), then you would not have to deal with this problem.

FoxWeb Support Team
support@foxweb.com email

Sent by Gene Gerard on 10/17/2002 02:55:07 PM:
Also, this same methodology is being used for the following flow of pages:
  A - Home Page (HTML)
       to
       B - Login Page - client enters login id (FWX)
           to
           C - Client Page - 2 category drop-down lists, (FWX)
                            various Radio Buttons & Check Boxes
                            and date range components
                to
                CD - Loader page that allows D to be loaded from C (FWX)
                    to                     
                    D - Client Query Results Page - suitable for printing (HTML)
 
The pages I'm working on now are A, B & C. The 'window-close' problem is between pages C and D.
 
The best I can do now is when I click page C to go to page D, a loader page CD loads D.
 
D then momentarily displays because it is executing a command to close page CD. It then goes back to CD with the security message asking the user if it is ok to close. When the page CD is closed, D displays.
 
This is as good as it gets and I'll leave it for now unless you can show me a way to eliminate the security message . . . which I heard can't be defeated. That's why I asked if there's a FoxWeb coding solution for closing windows as opposed to Javascript.
 
Regards,
 
Gene
 
Sent by FoxWeb Support on 10/16/2002 05:31:11 PM:
I dont' understand why you would need to dynamically create an FWX file.  Why not have a standard FWX file that dynamically creates HTML output, based on the data in RECORDS.DBF?
 
Also, what's the reason for opening a separate window to display page_3.fwx, if you are going to close the current window anyway?  Why not display the results in the current window?
 
In any case, if you want to close the current window right after you open the new window, you can simply use the window.close() method:
 
<BODY onLoad='window.open("page_3.fwx","1"); window.close()'>
 
Note that, unless the current window was opened programatically, the browser will ask you to verify that you want to close it.
 

 

Sent by Gene Gerard on 10/16/2002 12:25:49 PM:

How Do I Automatically Close A Window That's No Longer Needed?

I'm using a combination of Javascript and FoxWeb with the following methodology.


Step 1 - a button is clicked on 'PAGE_1.FWX' (html type)

Step 2 - a link is performed to 'PAGE_2.FWX' (html type)

Step 3 - FoxWeb script in 'PAGE_2.FWX' calls a function from a 'Procedure Library' program called 'PROCS.FXP' (prg type). This procedure dynamically

   a. creates 'PAGE_3.FWX' which is populated
      with data from 'RECORDS.DBF'

   b. linls to 'PAGE_3.FWX'

 

All this has been accomplished and works fine. The problem is that 'PAGE_2.FWX' is no longer needed. It is easy to put a text or button link on it to close the window but I would like this to occur automatically.

I've tried various variations of closing the screen, even with the timer but nothing has worked so far. Here's the working code in 'PAGE_2.FWX' :

<HTML><HEAD></HEAD>
<% =procs(1) %>
<SCRIPT LANGUAGE="JavaScript">
</SCRIPT></HEAD>
<BODY onLoad=window.open("page_3.fwx","1")>
</BODY></HTML>

I looked at the popup timer functions without success (this window is not a popup anyway). Can code maybe be put in 'PAGE_3.FWX'  that when loaded, would close 'PAGE_2.FWX' ?

Any ideas?

Gene