Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Internet Explorer and AjaxRequestTarget - Wicket1.X and trunk
Description
I write something like that :
<table>
<tr wicket:id="toBerefreshed">[...]</tr>
</table>
toBeRefreshed is re-render via a AjaxRequestTarget with addComponant.
The issues is : Javascript to replace tr node under IE use outerHTML but outerHTML is readOnly on table element. So replacement failed and an error such as "unknow error" is thrown.
The attaching patch works around this f..ing IE bug using DOM to replace table elements :
Index: /home/doume/dev/wicket/trunk/[WICKET TRUNCK]wicket/src/main/java/wicket/ajax/wicket-ajax.js
===================================================================
— /home/doume/dev/wicket/trunk/[WICKET TRUNCK]wicket/src/main/java/wicket/ajax/wicket-ajax.js (revision 479541)
+++ /home/doume/dev/wicket/trunk/[WICKET TRUNCK]wicket/src/main/java/wicket/ajax/wicket-ajax.js (working copy)
@@ -173,7 +173,18 @@
break;
}
}
- element.outerHTML=text;
+ try { + element.outerHTML=text; + }catch (e)
Unknown macro: {+ var tn = element.tagName;+ if(tn=='TBODY' || tn=='TR' || tn=='TD')+ { + var tempDiv = document.createElement("div"); + tempDiv.innerHTML = '<table id="tempTable" style="display: none">' + text + '</table>'; + element.parentNode.replaceChild(tempDiv.getElementsByTagName(tn).item(0), element); + }+ else throw e;+ }
for (var j = i; j < parent.childNodes.length && parent.childNodes[j] != next; ++j) {
Wicket.Head.addJavascripts(parent.childNodes[j]);