Hi Stephane,
Thanks for the reply.
IE is very very lazy with tables
(Firefox will do the job in less than 1 or 2 seconds)
Not if the data isn't coming back in 1 to 2 seconds. Locking? Pregnant
pauses? Volume? (First 10 rows are quick followed a stutter on the network
then a burst; who knows?)
Is the anorexic-client strategy the prevailing mind-set everywhere in the
HTML and Javascript world?
To turn off bloody batch-updating! When I change the screen I want the
screen to change. Am I not saying this right?
If you see the html below where I say: - "document.getjobs.rec_count.value
= rc;" I want the record counter to click-over on the screen (*as the rows
are being retrieved*) Yes, this is live-TV not a delayed telecast
I want the scroll-bar to diminish on my select-list, I want the user to
receive feed-back (and be empowered
, I don't want to have to simulate
recurrsion just so as to surrender the thread long enough to repaint my
3270. (But it looks like the quasi-event inducing timer is the only way to
go?)
But I'd still like to know why: -
while (selectRef.options.length > 0)
{
selectRef.remove(selectRef.options[0]);
}
_gets reflected on the screen immediately but: -
selectRef.options[selectRef.options.length] = new Option (jobMsg);
_does not?
can we see an example on line ?
(I'll not make myself an example of what I understand you're telling)
It's a work-in-progress and I'm not geared-up for it online, but the code
(and my knowledge of JS/HTML
is rather simple so I've attached it below.
can you precise : with which navigator(s)
IE6 on Windows2000.
Thanks again.
Cheers Richard Maher
queue_lookup.html (contains select list - job_list)
===================================================
<html>
<head>
<title>
Example Client for Tier3 demo queue-lookup server
Author: Richard Maher
</title>
<style>
h2
{
color: Turquoise;
}
p.credits
{
color: Turquoise;
}
.green_screen
{
color: Lime;
background-color: Black;
font-family: courier;
}
</style>
<script type="text/javascript">
function load()
{
chan =
parent.frames["cornucopiae"].document.getElementById("CornuCopiae");
}
var chan;
function enter(nextfield)
{
if (window.event && window.event.keyCode == 13)
{
nextfield.focus();
return false;
}
else
return true;
}
function num_only(numObj)
{
if (isNaN(numObj.value))
{
numObj.value = "";
alert("Numeric value required");
numObj.focus();
return false;
}
else
return true;
}
function job_lookup()
{
if (!num_only(document.getjobs.entry_number))
return false;
var recTypeLen = 2;
var recType = "";
var msgGetInfo = "10";
var jobInfo = "11";
var errorInfo = "00";
var zeroFill = "0000";
var maxRows = "9999";
var outPad = "";
var ok = true;
var selectRef = document.getjobs.job_list;
var msgEntry = "";
selectRef.options[0].selected=true;
var holdHdr = selectRef.options[0];
while (selectRef.options.length > 0)
{
selectRef.remove(selectRef.options[0]);
}
selectRef.options[0] = holdHdr
document.getjobs.job_list.size = 1;
msgEntry = document.getjobs.entry_number.value;
outPad = zeroFill.substring(0, (zeroFill.length - msgEntry.length));
chan.sendMessage(msgGetInfo.concat(outPad,msgEntry,maxRows));
if (chan.readMessage(recTypeLen) != recTypeLen)
{
alert ("Error receiving reply from server");
return false;
}
recType = chan.getString(0,recTypeLen);
if (recType == jobInfo)
{
ok = process_jobs();
}
else
{
if (recType == errorInfo)
{
ok = process_error();
}
else
{
alert ("Unknown message type " + recType);
return false;
}
}
if (!ok) return false;
document.getjobs.entry_number.focus();
return true;
}
function process_error()
{
document.getjobs.rec_count.value = 0;
var errMsgLen = 0;
var errLenLen = 3;
var alertMsg = "Error retrieving job entry information\n";
if (chan.readMessage() < errLenLen)
{
alert ("Error receiving Error Length from server");
return false;
}
errMsgLen = parseInt(chan.getString(0,errLenLen),10);
alertMsg = alertMsg + chan.getString(errLenLen,errMsgLen);
alert(alertMsg);
return true;
}
function process_jobs()
{
var recTypeLen = 2;
var recType = "";
var jobInfo = "11";
var eofInfo = "99";
var eofLen = 3;
var jobMsgLen = 109;
var jobMsg = "";
var rc = 1;
var eofInfo = "99";
var selectRef = document.getjobs.job_list;
for (;
{
document.getjobs.rec_count.value = rc;
rc = rc + 1;
if (rc < 6)
document.getjobs.job_list.size = rc;
if (chan.readMessage(jobMsgLen) != jobMsgLen)
{
alert ("Error receiving Job Information from server");
return false;
}
jobMsg = chan.getString(0,4) + "|" +
chan.getString(4,39) + "|" +
chan.getString(43,15) + "|" +
chan.getString(58,31) + "|" +
chan.getString(89,10) + "|" +
chan.getString(99,10);
selectRef.options[selectRef.options.length] = new Option (jobMsg);
if (chan.readMessage(recTypeLen) != recTypeLen)
{
alert ("Error receiving reply from server");
return false;
}
recType = chan.getString(0,recTypeLen);
if (recType != jobInfo)
break;
}
if (recType != eofInfo)
return false;
if (chan.readMessage(eofLen) != eofLen)
{
alert ("Error receiving reply from server");
return false;
}
return true;
}
</script>
</head>
<body onload="load()">
<h2>Example Client for Tier3 DEMO application server on VMS</h2><hr>
<form name="getjobs">
Enter Job Entry Number [Default is All jobs]:
<input
type="text"
onkeypress="return enter(document.getjobs.send)"
name="entry_number"
maxlength=4
size=4
dir="rtl"
/>
<input
type="button"
onmouseup="job_lookup()"
name="send"
value="Get Job Info."
/>
Jobs Found:
<input
type="text"
name="rec_count"
onchange="alert('change')"
readonly
value="0"
size=5
/>
<br /><br />
<select
name="job_list"
id="Job_list"
class="green_screen"
size=1>
<option
value="lovhdr"
selected=true
disable=trueNbr--Job-Name--------------------------------Job Status------Queue
Name----------------------Queue Type-Status----</option>
</select>
<br />
</form>
<div style="overflow:auto; height:180px;">
<p>
This is an example of a browser-based, html and JavaScript,
client interacting with a VMS hosted Tier3 Application Server
in a connection-oriented and context-rich Tier3 environment.<br /><br />
You would have noticed that, when this page was initially displayed,
you were immediately prompted for your VMS Username and Password.
Once authorization is successful your credentials, and an accompanying
Persona, are automatically made available to your 3GL User Action
Routines each time their Server Process is chosen to perform work on
behalf of the client. In this example, the user only gets to see those
Print and Batch jobs that they have privileges to view. You can find
the corresponding server code for this example (demo_uars.cob) in your
t3$examples directory.<br /><br />
The session and server connection are terminated when you change
web pages or refresh this page.
</p></div>
<hr>
<p class="credits">
"Tier3" is a registered trademark of Tier3 Software Ltd<br />
"CornuCopiae" is a trademark of Richard Maher
</p>
</body>
</html>
CornuCopiae.html - header with status info
==========================================
<html>
<head>
<title>
Example2 Sperate Cornucopiae control Frame
for Identification and status displays.
Author: Richard Maher
</title>
<style>
body
{
background-color: Turquoise;
color: Grey;
margin: 0;
padding: 0;
line-height: 0;
}
.cell1
{
font-family: Georgia;
font-size: 75%;
text-align: left;
width="33%";
}
.cell2
{
font-family: Georgia;
font-size: 150%;
font-weight: bold;
color: Black;
text-align: center;
width="34%";
}
.cell3
{
font-family: Georgia;
font-size: 75%;
text-align: right;
width="33%";
}
.revLeft
{
background-color: Grey;
color: Turquoise;
font-size: 75%;
font-weight: bold;
text-align: left;
}
.revRight
{
background-color: Grey;
color: Turquoise;
font-size: 75%;
font-weight: bold;
text-align: right;
}
</style>
<script type="text/javascript">
var chan;
var base;
var oneSec;
var oneMin;
var oneHour;
var oneDay;
var outDelta;
var intId;
function load()
{
chan = document.getElementById("CornuCopiae");
var username = chan.getUsername();
document.starship_ctrl.username.value=username;
oneSec = 1000;
oneMin = 60*oneSec;
oneHour= 60*oneMin;
oneDay = 24*oneHour;
base = chan.getConnectTime();
intId=self.setInterval("deltaClock()",1000);
}
function deltaClock()
{
var currDate = new Date();
var now = currDate.getTime();
var interval = (now - base);
var clockDays = Math.floor(interval / oneDay);
interval = interval - (clockDays * oneDay);
var clockHours = Math.floor(interval / oneHour);
interval = interval - (clockHours * oneHour);
var clockMins = Math.floor(interval / oneMin);
interval = interval - (clockMins * oneMin);
var clockSecs = Math.floor(interval / oneSec);
interval = interval - (clockSecs * oneSec);
outDelta = zPad(clockHours) + ":"
+ zPad(clockMins) + ":"
+ zPad(clockSecs) + " "
+ clockDays;
document.starship_ctrl.clock.value=outDelta;
}
function zPad(num)
{
if (num < 10)
{
num ="0" + num;
}
return num;
}
</script>
</head>
<body onload="load()">
<form name="starship_ctrl">
<table
border=0;
frame="void";
cellpadding="0";
cellspacing="0";
width="100%";
rules="none";
<tr
valign="middle";
<td
class="cell1";
valign="middle";
Username:
<input
name="username";
class="revLeft";
type="text";
size=10;
maxlength=10;
readonly="readonly";
/></td>
<td
class="cell2";
valign="middle";
<td
class="cell3";
valign="middle";
Connected:
<input
name="clock";
class="revRight";
type="text";
dir="rtl";
size=10;
maxlength=10;
readonly="readonly";
/></td>
</tr>
</table>
</form>
<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
width= "0" height= "0" name="CornuCopiae"
id="CornuCopiae">
<param name="archive" value="tier3.jar">
<param name="codebase"
value="
http://1.2.3.6/">
<param name="code" value="CornuCopiae">
<param name="mayscript" value="yes">
<param name="scriptable" value="true">
<param name="name" value="CornuCopiae">
<param name="PORT" value="1024">
<param name="HOSTCHARSET" value="ISO-8859-1">
<param name="MAXBUF" value="512">
<param name="APPLICATION" value="DEMO">
</object>
</body>
</html>
Example2.html (I use two frames)
================================
<html>
<frameset rows="5%,*">
<frame
src="cornucopiae.html";
name="cornucopiae";
marginheight="0";
marginwidth="0";
frameborder="1";
noresize="noresize";
scrolling="no";
/>
<frame
src="";
name="queue_lookup";
frameborder="0";
noresize="noresize";
scrolling="auto";
/>
</frameset>
</html>
ASM said:
Richard Maher a écrit :
Hi,
I have this Applet-hosted Socket connection to my server and in an
ONevent/function I am retrieving all these lovely rows from the server and
inserting them into the Select-List. (The on screen appearance of the Select
List grows for the first 5 rows then the scroll bar appears if there's
more). So far so good. . .
The problem is that none of the rows I'm inserting appear on the screen
until I have RETURNed from my function; so If it ended up being 1000 rows
then the user sees nothing until they're *all* processed :-( Is this an
IE6-only thing? Does it happen with Version 7 or with other browsers? This
is disgusting!
IE is very very lazy with tables
(Firefox will do the job in less than 1 or 2 seconds)
Is there an option to set somewhere?
to set what ?
you didn't show your function,
how to say what to set or to modify or ...
Do I have to hack/force some sort of event (with coresponding ONfunction)
and then RETURN from my function and have the ensuing function call me back
and repeat till eof? Yuck.
Probably, if you want *to see* your table growing,
you'll have to code for that feature ? no ?
mini example :
<html>
<script type="text/javascript">
// array of "lovely rows"
var R = [12,11,10,9,'c','d','e','one','two','tree'];
function insertMyRows(idx) {
var T = document.getElementById('myTable').insertRow(idx+1);
var D = document.createElement('TD');
D.innerHTML = R[idx];
T.appendChild(D);
}
function feedTable(timer) {
var L = R.length;
var i=0;
while(i<L) {
setTimeout('insertMyRows('+i+')',timer*i);
i++;
}
}
</script>
<form action="javascript:feedTable(document.form[0][0].value)">
Delay to see table growing :
<input onclick="this.select();" value="200">
and hit [Enter];
</form>
<a href="#" onclick="feedTable(200);return false;">grow table</a>
<table id="myTable">
<tr><th>tests</th></tr>
</table>
All I want to do is see my rows grow and counter increment in the
select-list (or table) as they appear; is that really too much to ask? Is
IBM3270 emulation crap really as far as we've got?
Regards Richard Maher
PS. The funny thing (or glimmer of hope!) is, when I loop till
list.options.length = 0 {list.remove(list.options[0])} I see the rows
disappear before my eyes. (Admittedly when i set the list.size = 1 it does
not take immediate effect but we're getting somewhere right? (I set it to 1
'cos I re-insert a "header row" at [0]))
can we see an example on line ?
(I'll not make myself an example of what I understand you're telling)
can you precise : with which navigator(s)