"please wait..." in content frame during computation

T

tanager

I have found lots of discussion of said subject, but nothing I try
will work. I'm hoping that starting this conversation with real
living people in 2007 will help.

I have two frames, left is toolbar, right is contents.
<frameset cols="35%,65%">
<frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
<frame src="cmpContents.html" name="contentsFrame">
</frameset>

The left frame is CGI, which takes an HTML template file and fills in
some pulldowns. The right frame is initially blank except for a
title. Pushing the submit button on the left frame calls CGI script
cmpRegressions.py, a slow computation/db access, so I want to repaint
the right side with "please wait..." while this is happening. I want
this to work after the right side has real contents too, obviously.

The most straightforward way seems to be using onsubmit or onclick.
Here is an excerpt of the template file which my left-side cgi fills
in.

<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
document.forms["toolbar"].submit();
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py"
ENCTYPE="multipart/
form-data">
....
....
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
....
....
<INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
false;">
</form>
</body>

Nothing I try will make the "submit" button change to the
cmpWaiting.html page when I click it. It does do the submit() via the
waitMsg() function, so the script is getting called AFAIK.

Notice, however, that I try the onclick technique on the "radio"
button in the middle of the form. It works fine! Of course, that
input is not running the cmpRegressions.py script, which is what the
submit button does.

I've tried putting the javascript code inline in the <input>, I've
tried onsubmit both in the <input> and in the <form>, I've tried too
many things to name. I'm pulling out my hair as I write this. What
am I missing?

Thanks,
David

P.S. I'm not married to frames, but if you suggest something else,
please bear in mind that I'm a newbie.
 
T

tanager

I have found lots of discussion of said subject, but nothing I try
will work. I'm hoping that starting this conversation with real
living people in 2007 will help.

I have two frames, left is toolbar, right is contents.
<frameset cols="35%,65%">
<frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
<frame src="cmpContents.html" name="contentsFrame">
</frameset>

The left frame is CGI, which takes an HTML template file and fills in
some pulldowns. The right frame is initially blank except for a
title. Pushing the submit button on the left frame calls CGI script
cmpRegressions.py, a slow computation/db access, so I want to repaint
the right side with "please wait..." while this is happening. I want
this to work after the right side has real contents too, obviously.

The most straightforward way seems to be using onsubmit or onclick.
Here is an excerpt of the template file which my left-side cgi fills
in.

<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
document.forms["toolbar"].submit();
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py"
ENCTYPE="multipart/
form-data">
...
...
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
...
...
<INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
false;">
</form>
</body>

Nothing I try will make the "submit" button change to the
cmpWaiting.html page when I click it. It does do the submit() via the
waitMsg() function, so the script is getting called AFAIK.

Notice, however, that I try the onclick technique on the "radio"
button in the middle of the form. It works fine! Of course, that
input is not running the cmpRegressions.py script, which is what the
submit button does.

I've tried putting the javascript code inline in the <input>, I've
tried onsubmit both in the <input> and in the <form>, I've tried too
many things to name. I'm pulling out my hair as I write this. What
am I missing?

Thanks,
David

P.S. I'm not married to frames, but if you suggest something else,
please bear in mind that I'm a newbie.


Please, please, someone! Trying different combinations, nothing
working... I removed the submit() call from the function and return
true instead (i.e., letting the form submit itself). I removed the
onclick action; put an onsubmit action in the <form> instead. Here is
what I've got:

function waitMsg() {
top.contentsFrame.location.href = "../cmpreg/
cmpWaiting.html";
// alert("yo");
return true;
}
.....
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py" ENCTYPE="multipart/
form-data" onsubmit="return waitMsg();">
<table>


Here's an interesting new detail. If I add in the alert() after the
modification of the location, the "waiting..." page appears on the
contents side before the real data. This is almost what I want --
except I don't want the alert -- but I'm hoping it will be a clue for
someone.

Note that the alert has this side effect for Firefox 2.0 on Ubuntu,
but not for IE6 on Windows XP.
 
D

Darko

I have found lots of discussion of said subject, but nothing I try
will work. I'm hoping that starting this conversation with real
living people in 2007 will help.
I have two frames, left is toolbar, right is contents.
<frameset cols="35%,65%">
<frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
<frame src="cmpContents.html" name="contentsFrame">
</frameset>
The left frame is CGI, which takes an HTML template file and fills in
some pulldowns. The right frame is initially blank except for a
title. Pushing the submit button on the left frame calls CGI script
cmpRegressions.py, a slow computation/db access, so I want to repaint
the right side with "please wait..." while this is happening. I want
this to work after the right side has real contents too, obviously.
The most straightforward way seems to be using onsubmit or onclick.
Here is an excerpt of the template file which my left-side cgi fills
in.
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
document.forms["toolbar"].submit();
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py"
ENCTYPE="multipart/
form-data">
...
...
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
...
...
<INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
false;">
</form>
</body>
Nothing I try will make the "submit" button change to the
cmpWaiting.html page when I click it. It does do the submit() via the
waitMsg() function, so the script is getting called AFAIK.
Notice, however, that I try the onclick technique on the "radio"
button in the middle of the form. It works fine! Of course, that
input is not running the cmpRegressions.py script, which is what the
submit button does.
I've tried putting the javascript code inline in the <input>, I've
tried onsubmit both in the <input> and in the <form>, I've tried too
many things to name. I'm pulling out my hair as I write this. What
am I missing?

P.S. I'm not married to frames, but if you suggest something else,
please bear in mind that I'm a newbie.

Please, please, someone! Trying different combinations, nothing
working... I removed the submit() call from the function and return
true instead (i.e., letting the form submit itself). I removed the
onclick action; put an onsubmit action in the <form> instead. Here is
what I've got:

function waitMsg() {
top.contentsFrame.location.href = "../cmpreg/
cmpWaiting.html";
// alert("yo");
return true;
}
.....
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py" ENCTYPE="multipart/
form-data" onsubmit="return waitMsg();">
<table>

Here's an interesting new detail. If I add in the alert() after the
modification of the location, the "waiting..." page appears on the
contents side before the real data. This is almost what I want --
except I don't want the alert -- but I'm hoping it will be a clue for
someone.

Note that the alert has this side effect for Firefox 2.0 on Ubuntu,
but not for IE6 on Windows XP.

<html>
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "frameRight2.html";
// this is just so it doesn't load really fast
// on my local that I don't see if "Loading..." has shown.
// replace it with:
// document.forms['toolbar'].submit();
setTimeout( "document.forms['toolbar'].submit();", 2000 );
return false;
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST"

ACTION="frameLeft2.html" ENCTYPE="multipart/form-data">
....<br />
....<br />
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='frameRight2.html';">
....<br />
....<br />
<INPUT TYPE="submit" VALUE="compare" onclick="return waitMsg();">
</form>
</body>
</html>
 
T

tanager

I have found lots of discussion of said subject, but nothing I try
will work. I'm hoping that starting this conversation with real
living people in 2007 will help.
I have two frames, left is toolbar, right is contents.
<frameset cols="35%,65%">
<frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
<frame src="cmpContents.html" name="contentsFrame">
</frameset>
The left frame is CGI, which takes an HTML template file and fills in
some pulldowns. The right frame is initially blank except for a
title. Pushing the submit button on the left frame calls CGI script
cmpRegressions.py, a slow computation/db access, so I want to repaint
the right side with "please wait..." while this is happening. I want
this to work after the right side has real contents too, obviously.
The most straightforward way seems to be using onsubmit or onclick.
Here is an excerpt of the template file which my left-side cgi fills
in.
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
document.forms["toolbar"].submit();
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py"
ENCTYPE="multipart/
form-data">
...
...
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
...
...
<INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
false;">
</form>
</body>
Nothing I try will make the "submit" button change to the
cmpWaiting.html page when I click it. It does do the submit() via the
waitMsg() function, so the script is getting called AFAIK.
Notice, however, that I try the onclick technique on the "radio"
button in the middle of the form. It works fine! Of course, that
input is not running the cmpRegressions.py script, which is what the
submit button does.
I've tried putting the javascript code inline in the <input>, I've
tried onsubmit both in the <input> and in the <form>, I've tried too
many things to name. I'm pulling out my hair as I write this. What
am I missing?
Thanks,
David
P.S. I'm not married to frames, but if you suggest something else,
please bear in mind that I'm a newbie.
Please, please, someone! Trying different combinations, nothing
working... I removed the submit() call from the function and return
true instead (i.e., letting the form submit itself). I removed the
onclick action; put an onsubmit action in the <form> instead. Here is
what I've got:
function waitMsg() {
top.contentsFrame.location.href = "../cmpreg/
cmpWaiting.html";
// alert("yo");
return true;
}
.....
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py" ENCTYPE="multipart/
form-data" onsubmit="return waitMsg();">
<table>
Here's an interesting new detail. If I add in the alert() after the
modification of the location, the "waiting..." page appears on the
contents side before the real data. This is almost what I want --
except I don't want the alert -- but I'm hoping it will be a clue for
someone.
Note that the alert has this side effect for Firefox 2.0 on Ubuntu,
but not for IE6 on Windows XP.

<html>
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "frameRight2.html";
// this is just so it doesn't load really fast
// on my local that I don't see if "Loading..." has shown.
// replace it with:
// document.forms['toolbar'].submit();
setTimeout( "document.forms['toolbar'].submit();", 2000 );
return false;
}
</script>
<base target="contentsFrame">
</head>

OK, fantastic, that has the desired side effect in FF and IE.
However, I'm still confused.
- The initial 'contents' page is blank with only a title.
- The 'wait' page has no title and says to wait.
- The generated 'results' page has a different background color.
How could I miss seeing the 'wait' page load between the 'contents'
and 'results' pages? If 'wait' loaded at all, the 'contents' page
would disappear, which never happened before I added the setTimeout()
call. Rather, the 'contents' page used to remain during the
computation (5 seconds+) and then was quickly replaced by the results.

Since this workaround works, I don't want to remove the setTimeout()
call as suggested by the comment. Unless Darko or others can figure
out how to make it work without the timeout, I'm just going to leave
it in (with reduced timeout), because this has about driven me crazy.

Thanks much,
David
 
D

Darko

I have found lots of discussion of said subject, but nothing I try
will work. I'm hoping that starting this conversation with real
living people in 2007 will help.
I have two frames, left is toolbar, right is contents.
<frameset cols="35%,65%">
<frame src="../cgi-bin/cmpToolbar.py" name="toolbarFrame">
<frame src="cmpContents.html" name="contentsFrame">
</frameset>
The left frame is CGI, which takes an HTML template file and fills in
some pulldowns. The right frame is initially blank except for a
title. Pushing the submit button on the left frame calls CGI script
cmpRegressions.py, a slow computation/db access, so I want to repaint
the right side with "please wait..." while this is happening. I want
this to work after the right side has real contents too, obviously.
The most straightforward way seems to be using onsubmit or onclick.
Here is an excerpt of the template file which my left-side cgi fills
in.
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "../cmpreg/cmpWaiting.html";
document.forms["toolbar"].submit();
}
</script>
<base target="contentsFrame">
</head>
<body>
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py"
ENCTYPE="multipart/
form-data">
...
...
<input type="radio" name="inputType" value="buildset"
onclick="parent.contentsFrame.location='../cmpreg/cmpWaiting.html';">
...
...
<INPUT TYPE="submit" VALUE="compare" onclick="waitMsg(); return
false;">
</form>
</body>
Nothing I try will make the "submit" button change to the
cmpWaiting.html page when I click it. It does do the submit() via the
waitMsg() function, so the script is getting called AFAIK.
Notice, however, that I try the onclick technique on the "radio"
button in the middle of the form. It works fine! Of course, that
input is not running the cmpRegressions.py script, which is what the
submit button does.
I've tried putting the javascript code inline in the <input>, I've
tried onsubmit both in the <input> and in the <form>, I've tried too
many things to name. I'm pulling out my hair as I write this. What
am I missing?
Thanks,
David
P.S. I'm not married to frames, but if you suggest something else,
please bear in mind that I'm a newbie.
Please, please, someone! Trying different combinations, nothing
working... I removed the submit() call from the function and return
true instead (i.e., letting the form submit itself). I removed the
onclick action; put an onsubmit action in the <form> instead. Here is
what I've got:
function waitMsg() {
top.contentsFrame.location.href = "../cmpreg/
cmpWaiting.html";
// alert("yo");
return true;
}
.....
<FORM id="toolbar" name="toolbar" target=contentsFrame
METHOD="POST" ACTION="../cgi-bin/cmpRegressions.py" ENCTYPE="multipart/
form-data" onsubmit="return waitMsg();">
<table>
Here's an interesting new detail. If I add in the alert() after the
modification of the location, the "waiting..." page appears on the
contents side before the real data. This is almost what I want --
except I don't want the alert -- but I'm hoping it will be a clue for
someone.
Note that the alert has this side effect for Firefox 2.0 on Ubuntu,
but not for IE6 on Windows XP.
<html>
<head>
<script type="text/javascript">
function waitMsg() {
top.contentsFrame.location = "frameRight2.html";
// this is just so it doesn't load really fast
// on my local that I don't see if "Loading..." has shown.
// replace it with:
// document.forms['toolbar'].submit();
setTimeout( "document.forms['toolbar'].submit();", 2000 );
return false;
}
</script>
<base target="contentsFrame">
</head>

OK, fantastic, that has the desired side effect in FF and IE.
However, I'm still confused.
- The initial 'contents' page is blank with only a title.
- The 'wait' page has no title and says to wait.
- The generated 'results' page has a different background color.
How could I miss seeing the 'wait' page load between the 'contents'
and 'results' pages? If 'wait' loaded at all, the 'contents' page
would disappear, which never happened before I added the setTimeout()
call. Rather, the 'contents' page used to remain during the
computation (5 seconds+) and then was quickly replaced by the results.

Since this workaround works, I don't want to remove the setTimeout()
call as suggested by the comment. Unless Darko or others can figure
out how to make it work without the timeout, I'm just going to leave
it in (with reduced timeout), because this has about driven me crazy.

Thanks much,
David

It's logical to me that it can't, since you targeted one
window with one url, and then immediately targeted it with another
url. The
browser normally presumes that the first one is unneeded and cancels
it.

I think you should base your solution on inserting some contents
dynamically into
a container in the current right page, which will happen
instantaneously, and then
do the submit() action.
 

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,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top