FoxInCloud
wchtmlgen and SCRIPT-FOR-EVENT
Gravatar is a globally recognized avatar based on your email address. wchtmlgen and SCRIPT-FOR-EVENT
  Tuvia Vinitsky
  All
  Aug 3, 2015 @ 08:13pm
I have a container on a form. The purpose of that container is to instantiate a special activeX object. So I do this, which I have done many times before:

.wcHTMLGen

lcHTML = filetostr('mycoolhtml.inc')

this.wcHTML = lcHTML

Works great. Now in order to bind some code to a method of this activeX object, I must issue the following. This is the only way it can work.

<SCRIPT LANGUAGE=javascript FOR="SigPlus1" EVENT="PenDown">
sigPenDown();
</SCRIPT>

note the special IE parameters of FOR and EVENT. I KNOW it would be better not use them, no lectures. There is no choice at the moment. However if I include this special SCRIPT in my html generation file, it does not seem to become part of the HTML. I have tried forcing it into the HEAD section, I have tried appending the script at the end of the DOM with scriptadd_ (or whatever the proc is in awserver). The normal script procedures do not allow for the FOR and EVENT params. It works in a plain vanilla HTML page. The INC file looks like this:

<TABLE height=150 cellPadding=0 width=286 border=1 style="background-color:red" id="SigTable">
<TR>
<TD>
<OBJECT id=SigPlus1
style="WIDTH: 300px; HEIGHT: 150px" classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A name=SigPlus1
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="131095">
<PARAM NAME="_ExtentX" VALUE="4842">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
</TD>
</TR>
</TABLE>

<SCRIPT LANGUAGE=javascript FOR="SigPlus1" EVENT="PenDown">
sigPenDown();
</SCRIPT>

<SCRIPT>
sigClear();
sigSign();
</SCRIPT>

Gravatar is a globally recognized avatar based on your email address. Re: wchtmlgen and SCRIPT-FOR-EVENT
  Tuvia Vinitsky
  Tuvia Vinitsky
  Aug 3, 2015 @ 08:23pm
Well, it seems I did find an alternative, with a not that well known syntax for ActiveX methods. This seems to work, as it does not need the FOR and EVENT. After massive research, these seem to be the only 2 ways to do this.
<script type="text/javascript">
function SigPlus1::PenDown()
{
sigPenDown();
}
</script>


I have a container on a form. The purpose of that container is to instantiate a special activeX object. So I do this, which I have done many times before:

.wcHTMLGen

lcHTML = filetostr('mycoolhtml.inc')

this.wcHTML = lcHTML

Works great. Now in order to bind some code to a method of this activeX object, I must issue the following. This is the only way it can work.

<SCRIPT LANGUAGE=javascript FOR="SigPlus1" EVENT="PenDown">
sigPenDown();
</SCRIPT>

note the special IE parameters of FOR and EVENT. I KNOW it would be better not use them, no lectures. There is no choice at the moment. However if I include this special SCRIPT in my html generation file, it does not seem to become part of the HTML. I have tried forcing it into the HEAD section, I have tried appending the script at the end of the DOM with scriptadd_ (or whatever the proc is in awserver). The normal script procedures do not allow for the FOR and EVENT params. It works in a plain vanilla HTML page. The INC file looks like this:

<TABLE height=150 cellPadding=0 width=286 border=1 style="background-color:red" id="SigTable">
<TR>
<TD>
<OBJECT id=SigPlus1
style="WIDTH: 300px; HEIGHT: 150px" classid=clsid:69A40DA3-4D42-11D0-86B0-0000C025864A name=SigPlus1
VIEWASTEXT>
<PARAM NAME="_Version" VALUE="131095">
<PARAM NAME="_ExtentX" VALUE="4842">
<PARAM NAME="_ExtentY" VALUE="1323">
<PARAM NAME="_StockProps" VALUE="0">
</OBJECT>
</TD>
</TR>
</TABLE>

<SCRIPT LANGUAGE=javascript FOR="SigPlus1" EVENT="PenDown">
sigPenDown();
</SCRIPT>

<SCRIPT>
sigClear();
sigSign();
</SCRIPT>


© 1996-2024