Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: "Patrick Ruzand" <glhu@xxxxxxxxxxxxx>
- Date: Thu, 15 Mar 2007 15:18:59 +0100
Hi Walter,[...]
I made some progress on this issue. I finally found a workaround.
Please find below my comments.
You will find below the code of an html page that basically does what
the MS Ajax library is doing at init time using the DOM API.
As it is, it reproduces the behavior I have with MS js lib.
it's better with the code...
---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---8<---
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
</head>
<body>
<script type="text/javascript">
function wireEventHandler(target, eventName, handler) {
var elt = document.getElementById(target);
if (elt.addEventListener) {
// Begin Firefox workaround
// *** Uncomment the line below to fix the issue ***
// elt.tabIndex = -1;
// End Firefox workaround
elt.addEventListener(eventName, handler, true);
}
}
function foo(e) {
alert('onkeydown: ' + e.target.id);
}
</script>
<input type="text" id="text" />
<div id="mydiv" style="width:100px;height:100px;background-color:blue"
</div>
<div style="left: 5px; width: 500px; position: absolute; top: 105px; height:
500px">
<div id="MyControl1"
style="background-color:red;position:relative;left:5px;top:5px;width:500px;height:500px;">
</div>
</div>
<script type="text/javascript">
wireEventHandler('MyControl1','keydown', foo);
</script>
</body>
</html>
.
- References:
- [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: Patrick Ruzand
- RE: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: Walter Wang [MSFT]
- Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: Patrick Ruzand
- Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: Walter Wang [MSFT]
- Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- From: Patrick Ruzand
- [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- Prev by Date: Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- Next by Date: Re: Adjusting the Design Time output of control derived from a TextBox
- Previous by thread: Re: [AJAX] custom control implementing IScriptControl : no key events notification in firefox
- Next by thread: Re: multiple selection in listbox
- Index(es):
Relevant Pages
|
Loading