3.2.0

IE Runtime Error on AW.HTML.TR.refresh()

I'm encountering a problem when using my subclass of AW.HTML.TABLE. I've overriden the refresh method so that it can do something with some xml (not shown for simplicity), but when I call the row to refresh, IE6 throws an exception ("Runtime Error"). Have a look at the code below:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">

<script src="./runtime/lib/aw.js"></script>

<link href="./runtime/styles/xp/aw.css" rel="stylesheet"></link>

<style>
.aw-div-outerdiv {border: 1px solid green; height: 50px; }
.aw-table-table {border: 1px solid red; height: 100%; }
.aw-row-row {border: 1px solid yellow; }
.aw-cell-cell {border: 1px solid blue; }
</style>

</head>

<body>

<script>

var CustomTable = AW.HTML.TABLE.subclass();
CustomTable.create = function(){
var obj = this.prototype;
var _super = this.superclass.prototype;

obj.init = function() {
_super.init.call(this);
systemHTMLRow = new AW.HTML.TR;
systemHTMLRow.setClass("row", "row");
this.setContent("row", systemHTMLRow);

this.setClass("table", "table");
this.addCell("cellA", "Refreshing the row after adding this cell causes no problems in IE6 or Firefox");
this.getContent("row").refresh();
}

obj.addCell = function(key, message) {
cell = new AW.HTML.TD;
cell.setClass("cell", "cell");
var testLabel = new AW.UI.Label;
testLabel.setControlText(message);
cell.setContent("label", testLabel);
this.getContent("row").setContent(key, cell);
}

obj.refresh = function() {
this.addCell("cellB", "Refreshing the row after adding this cell causes problems in IE6 only");
this.getContent("row").refresh();
}
}

function refreshTable() {
alert("calling CustomTable.refresh()...");
table.refresh();
};

var outerDiv = new AW.HTML.DIV;
outerDiv.setClass("div", "outerdiv");
var table = new CustomTable();
outerDiv.setContent("content", table);
document.write(outerDiv);
refreshTable();
</script>

</body>
</html>
June 13,
Yes, this is very annoying limitation of IE - it does not allow changing html table structure using innerHTML or outerHTML. Initially Microsoft had its own proprietary API for all operations with tables. I guess the DOM methods should now work as well (but I'm not 100% sure).
Alex (ActiveWidgets)
June 13,
But if you want to use inner/outerHTML or AW refresh() method you should either refresh the whole table or the content inside the table cell.
Alex (ActiveWidgets)
June 13,
Thanks. How would your recommendation translate into code; I tried adding _super.refresh.call(this) to my refresh method to no effect.
June 13,
Can anyone help me with this problem? I'm still unsure of how to get an existing table to refresh changes to the rows within. The problem affects IE6.
June 19,

This topic is archived.

See also:


Back to support forum