And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
I am almost crazy after about 60 hours with this control.
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existance returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
-- thn (FoxInCloud)
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
-- thn (FoxInCloud)
you could try this
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript
That did not seem to help me.
you could try this
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
-- thn (FoxInCloud)
From what I read on SO posts, I'd rather put activeX controls on a master page
http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript
That did not seem to help me.
you could try this
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
From what I read on SO posts, I'd rather put activeX controls on a master page
http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript
That did not seem to help me.
you could try this
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
From what I read on SO posts, I'd rather put activeX controls on a master page
http://stackoverflow.com/questions/150814/how-to-handle-an-activex-event-in-javascript
That did not seem to help me.
you could try this
procedure wcHTMLgen
LPARAMETERS toHTMLgen AS awHTMLgen OF awHTML.prg, tlInnerHTMLthis.wcHTML = filetostr('mycoolhtml.inc')
toHTMLgen.cScriptJSadd([$('SigPlus1').observe('PenDown', sigPenDown);])
I am somewhat ignorant about the prototype observe function, and reading the prototype docs on it confused me further.
What do I get from this and where would I use it?
thanks
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
-- thn (FoxInCloud)
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
-- thn (FoxInCloud)
I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:
<script type="text/javascript">SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);</script>
produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });
ERROR: return statement outside of function.
The same code in urt.js but called from the objects wchtmlgen:
<script type="text/javascript">sigSign();
</script>
works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.
However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<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 type="text/javascript">
function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">sigSign();
</script>
I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
You are right about the event handlers; MS has an article on how to properly destroy an AciveX - and concludes you cannot communicate fully with an ActiveX via IE, period. Nice.
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
-- thn (FoxInCloud)
<script type="text/javascript">
(function(){
SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
})();
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);</script>
Went through the - awfully complex - topaz documentation;
from http://www.topazsystems.com/Software/download/sigweb.pdf I realized that this software could also be used in Chrome and FireFox, as a <canvas> rather than an activeX object - might be a way to work around your troubles, in such case getting support from topaz seems necessary.
This seems to definitely be related somehow to prototype etc.
I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:
<script type="text/javascript">SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);</script>
produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });
ERROR: return statement outside of function.
The same code in urt.js but called from the objects wchtmlgen:
<script type="text/javascript">sigSign();
</script>
works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.
However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<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 type="text/javascript">
function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">sigSign();
</script>
I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^
https://msdn.microsoft.com/en-us/library/ms537508.aspx
could you provide the URL?
You are right about the event handlers; MS has an article on how to properly destroy an AciveX - and concludes you cannot communicate fully with an ActiveX via IE, period. Nice.
The first reason I would think of: when the activeX is destroyed, its event handlers are still hanging around.
Prototype does a good job releasing the event handlers whenever an element is destroyed
I would try:
$('SigPlus1').observe('PenDown', sigPenDown); // or function(event){}
also the author of this post may help you:
http://stackoverflow.com/questions/10236040/how-to-access-topaz-signature-pad-activex-object-through-javascript
When I instantiate the <OBJECT> activeX it works fine. But if I "close" the form, which is a child form, and then open it again, it's mess. The object is still there, but it can no longer be communicated with. calling its method that just checks for its existence returns false.
And it is not enough to refresh, I have to actually stop and start the server.
Where do I go?
the Prototype error you have is normal - 'return' executes outside of a function(); you could wrap your code inside a self-executing function:
<script type="text/javascript">
(function(){
SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
})();
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);</script>
Went through the - awfully complex - topaz documentation;
from http://www.topazsystems.com/Software/download/sigweb.pdf I realized that this software could also be used in Chrome and FireFox, as a <canvas> rather than an activeX object - might be a way to work around your troubles, in such case getting support from topaz seems necessary.
This seems to definitely be related somehow to prototype etc.
I tried rather than calling a function in urt.js, I put the script in the form in wchtmlgen of an object. The code:
<script type="text/javascript">SigPlus1.ClearTablet();
SigPlus1.TabletState = 1; //Turns tablet on to collect signature
if(SigPlus1.TabletState == 0)
{
alert("Cannot locate signature pad! Please check that it is connected before continuing.");
SigPlus1.TabletComTest = false;
return 0;
}
SigPlus1.LCDSetTabletMap(0, 240, 64, 100, 0, 1900, 700);</script>
produces a prototype error at line 634
function evalScripts() {
return this.extractScripts().map(function(script) { return eval(script); });
ERROR: return statement outside of function.
The same code in urt.js but called from the objects wchtmlgen:
<script type="text/javascript">sigSign();
</script>
works the first time the form is loaded. But if I "close" the form, it will not instantiate again. There are no error messages and stepping thru the code is no help, the code executes as it should but does not communicate with the device.
However if I just place the code in an HTML file and only include the JS scripts for the device, I have no problems at all. Like this works perfectly:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" charset="utf-8">
<head>
<script type="text/javascript" charset="utf-8" src="urtsig.js"></script>
<script type="text/javascript" charset="utf-8" src="SigWebTablet.js"></script>
</head>
<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 type="text/javascript">
function SigPlus1::PenDown()
{
// originally we used script type=javascript for=sigplus1 event=pendown (with correct case) and the FiC merge choked on it.
// this is the only other way to attach code to an activex custom method:
sigPenDown();
}
</script>
<script type="text/javascript">sigSign();
</script>
I assume the activeX control executes outside of the browser, as a separate Windows process bound to the browser window.
Maybe when the page closes, the activeX control's process still executes (can be checked using the Windows task manager).
When the page reopens, it just re-binds to the extant process. At this point it then may be impossible to re-define the events handlers.
To overcome this, it might help to attach the event handler function() to the browser window; something like:
window.myHandler = function(){...};
control::event = window.myHandler;
I'm familiar with that post; the only thing that works is the SCRIPT FOR EVENT or the CONTROL::EVENT, I am using the latter. It works perfectly outside of FiC in a plain HTML page, but there I can use the FOR EVENT IE syntax. And in FiC it works the first time with the CONTROL::EVENT, but not subsequent times.
https://social.msdn.microsoft.com/Forums/ie/en-US/47eccb01-8089-4653-a0ce-45e9ced5e228/addeventlistener-for-activex-events-in-ie11?forum=iewebdevelopment
Fortunately, there is a simple work-around: force IE 10 emulation, by adding the following to the document's `<head>`:
<meta http-equiv="X-UA-Compatible" content="IE=10" />
and then use `attachEvent`, as before.
https://social.msdn.microsoft.com/Forums/ie/en-US/bb5db2d7-aa05-49a6-bfaf-b6f32913ae8e/correct-way-to-handle-custom-activex-events-in-javascript?forum=iewebdevelopment
note: foxInCloud operates in standard mode
You haven't specified a DTD (document type declaration) so MSIE browsers see your page as Quirks, so yes <script for= is (and always has been) valid for use with Quirks Mode...
Other browsers treat no DTD as a Unknown DTD and use the most standards compliant mode (HTML 4)... they do not recognise it as the for and event attributes of the <script> tag are MS proprietary.
Issues will arrise if your migrate to a Standards DTD and use AddEventListener or AttachEvent..... these methods cumulatively add event handlers to an element, so you can have a number of method attached to an element event handler...
see
http://www.quirksmode.org/js/events_advanced.html
and
http://www.idocs.com/tags/scripts/_SCRIPT_FOR.html
The above recommend that you do not use it.....
You should be looking at migrating away from Quirks see http://msdn.microsoft.com/en-us/library/cc288325(v=VS.85).aspx
Rob^_^