3.2.0

onKeyPress fails in Opera 9.25

Hi Alex,

The following code gives an alert with the key pressed in FireFox and IE.
However, there's no alert in Opera.

Regards,
Ankur

<html>
<head>
    <script src="runtime/lib/aw.js"></script>
    <link href="runtime/styles/xp/aw.css" rel="stylesheet"></link>
</head>
<body>
<script>
var obj = new AW.Grid.Extended;
obj.setCellText(function(i, j){return j + "." + i});
obj.setHeaderText("header");

obj.setColumnCount(10);
obj.setRowCount(100);

obj.setCellEditable(false);

obj.onKeyPress = function(event) {

    var key = String.fromCharCode(event.keyCode || event.charCode);
    alert(key);

}

document.write(obj);
</script>
</body>
</html>
Ankur Motreja
February 3,
This is a bug in AW - onKeyPress event does not work in Opera. It will be fixed in the next release, and in the meantime you can use the following code -

obj.setEvent("onkeypress", function(event){
    var key = String.fromCharCode(event.keyCode || event.charCode);
    alert(key);
});


Alex (ActiveWidgets)
February 4,
Fixed in AW 2.5.2.

http://www.activewidgets.com/general.bugs/2-5-2.html
Alex (ActiveWidgets)
July 3,

This topic is archived.

See also:


Back to support forum