Wait Window function

G

GTi

Hello...

I have a page located in a frame. This page contains a form.
When the user submit this form I want to popup a "Please Wait" window popup
window
The post may take some time for the server to process.
So when the new windows is loaded into the browser, I want to close this
Wait window.

I have found a global JavaScript variable I may use.
Like: top.waitwindow
So when the user press submit I use onSubmit=openWaitWindow()
And at the bottom I use top.waitwindow.close();

But this is not working at all.

Declared in the frame window
top.WaitWindowVar = null;

On the submit page
function openWaitWindow()
{
top.WaitWindowVar=window.showModelessDialog("WaitWindow.html","Dialog
Arguments Value","dialogHeight:100px; dialogWidth:200px; dialogTop:px;
dialogLeft:px; edge:Raised; center:Yes; help:No; resizable:No; status:No;
scroll:No; Unadorned:Yes ");
}

And at the bottom on the new page:
top.WaitWindowVar.close();


Any idea how I can do this?
 
T

Thomas 'PointedEars' Lahn

GTi said:
I have a page located in a frame. This page contains a form.
When the user submit this form I want to popup a "Please Wait" window popup
window

You don't want to do this. Popup windows are a Bad Thing. They allocate
system resources which often are not freed completely when the windows are
closed (especially on Windows 9x) and are therefore to be avoided.

Besides, the window object needs to be created first, so it is likely that
on a low-end system or a thin bandwidth connection the send process is
complete before the popup window or its document is even loaded completely.

And last but not least, for the first reason popup windows can and will be
blocked by users.
The post may take some time for the server to process.
So when the new windows is loaded into the browser, I want to close this
Wait window.

When submitting a form, there is generally no need to let the user know that
they must wait, since on all UAs I know, the submitting window is blocked
and a `wait' cursor (an hourglass with default Windows cursor scheme) or
something comparable is displayed.

But if you think a feedback is required anyway, you should use JavaScript
to manipulate the DOM, maybe showing a `Wait' text instead within the
submitting document.

If you want to counteract multiple clicking of the submit button (a known
problem,) you can set a timeout on click of the button to disable it and
re-enable it in the onunload handler of the window or document (in the case
someone uses the `Back' button if the submit failed.)
function openWaitWindow()
{
top.WaitWindowVar=window.showModelessDialog("WaitWindow.html","Dialog
Arguments Value","dialogHeight:100px; dialogWidth:200px; dialogTop:px;
dialogLeft:px; edge:Raised; center:Yes; help:No; resizable:No; status:No;
scroll:No; Unadorned:Yes ");
}

You know that this is IE-only? For popup windows you use the
window.open(...) method. And it is evil[tm] that you forbid
the user to scroll the window content *and* also forbid that
they resize the window here. How do you think they get to the
information if their settings (font size, content zoom aso.)
don't allow the content to be displayed within the rectangle
you specified?

The following shows the scrollbars. If you don't like them
to be displayed, change `scrollbars' into `resizable' (since
`no' is the default for both options):

top.foobar = window.open("WaitWindow.html", "foo_bar",
"height=100,width=200,scrollbars=yes,dependent=yes");


PointedEars
 
G

GTi

Thomas,
If my project was a "public" internet web page,
I totally agree with you.
But, in this case we are talking about a software with web interface.
We say it will only work with IE 5.5 or newer since this is the
world leading browser today (no more discussions please).
So I will continue to find a solution to display some kind of
"Please Wait" window with only a gif picture on it
(That why I don't need scrollbars on it).



Thomas 'PointedEars' Lahn said:
GTi said:
I have a page located in a frame. This page contains a form.
When the user submit this form I want to popup a "Please Wait" window popup
window

You don't want to do this. Popup windows are a Bad Thing. They allocate
system resources which often are not freed completely when the windows are
closed (especially on Windows 9x) and are therefore to be avoided.

Besides, the window object needs to be created first, so it is likely that
on a low-end system or a thin bandwidth connection the send process is
complete before the popup window or its document is even loaded completely.

And last but not least, for the first reason popup windows can and will be
blocked by users.
The post may take some time for the server to process.
So when the new windows is loaded into the browser, I want to close this
Wait window.

When submitting a form, there is generally no need to let the user know that
they must wait, since on all UAs I know, the submitting window is blocked
and a `wait' cursor (an hourglass with default Windows cursor scheme) or
something comparable is displayed.

But if you think a feedback is required anyway, you should use JavaScript
to manipulate the DOM, maybe showing a `Wait' text instead within the
submitting document.

If you want to counteract multiple clicking of the submit button (a known
problem,) you can set a timeout on click of the button to disable it and
re-enable it in the onunload handler of the window or document (in the case
someone uses the `Back' button if the submit failed.)
function openWaitWindow()
{
top.WaitWindowVar=window.showModelessDialog("WaitWindow.html","Dialog
Arguments Value","dialogHeight:100px; dialogWidth:200px; dialogTop:px;
dialogLeft:px; edge:Raised; center:Yes; help:No; resizable:No; status:No;
scroll:No; Unadorned:Yes ");
}

You know that this is IE-only? For popup windows you use the
window.open(...) method. And it is evil[tm] that you forbid
the user to scroll the window content *and* also forbid that
they resize the window here. How do you think they get to the
information if their settings (font size, content zoom aso.)
don't allow the content to be displayed within the rectangle
you specified?

The following shows the scrollbars. If you don't like them
to be displayed, change `scrollbars' into `resizable' (since
`no' is the default for both options):

top.foobar = window.open("WaitWindow.html", "foo_bar",
"height=100,width=200,scrollbars=yes,dependent=yes");


PointedEars
 
G

Guy Roydor

essayez le processus suivant :

1) form is send to server (by action="myprog")

2) server send page with code <h1> WAIT </h1> to display

3) server works (store data etc..)

4) server at end : send '<script>
href.location="javascript:history.go(-1);"</script>'



GTi a écrit:
 
T

Thomas 'PointedEars' Lahn

GTi said:
[...]
We say it will only work with IE 5.5 or newer since this is the
world leading browser today (no more discussions please).
[...]
[Fullquote]

As you wish.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top