Issue Details (XML | Word | Printable)

Key: WICKET-143
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matej Knopp
Reporter: Vincent Demay
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Wicket

[PATCH]Re-render a table element via AjaxRequestTarget under IE does not works

Created: 05/Dec/06 06:07 PM   Updated: 06/Dec/06 08:29 AM
Return to search
Component/s: wicket
Affects Version/s: None
Fix Version/s: 1.2.4, 1.3.0-beta1, 2.0 branch (discontinued)

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works patch.txt 2006-12-05 06:08 PM Vincent Demay 1 kB
Environment: Internet Explorer and AjaxRequestTarget - Wicket1.X and trunk

Resolution Date: 05/Dec/06 09:46 PM


 Description  « Hide
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) {
+ 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]);


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vincent Demay added a comment - 05/Dec/06 06:08 PM
I also attach the patch as new file easier to apply ;)

Vincent Demay made changes - 05/Dec/06 06:08 PM
Field Original Value New Value
Attachment patch.txt [ 12346467 ]
Igor Vaynberg made changes - 05/Dec/06 06:16 PM
Assignee Matej Knopp [ knopp ]
Repository Revision Date User Message
ASF #482755 Tue Dec 05 20:11:43 UTC 2006 knopp Support for ajax replacement for tr,td,thead,tbody elements (WICKET-143)
Files Changed
MODIFY /incubator/wicket/trunk/wicket/src/main/java/wicket/ajax/wicket-ajax.js

Repository Revision Date User Message
ASF #482758 Tue Dec 05 20:15:30 UTC 2006 knopp Support for ajax replacement for tr,td,thead,tbody elements (WICKET-143)
Files Changed
MODIFY /incubator/wicket/branches/wicket-1.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js

Repository Revision Date User Message
ASF #482793 Tue Dec 05 21:40:05 UTC 2006 knopp Support for ajax replacement for tr,td,thead,tbody,tfoot,colgroup, col elements (WICKET-143)
Files Changed
MODIFY /incubator/wicket/branches/wicket-1.2.x/wicket/src/main/java/wicket/ajax/wicket-ajax.js

Matej Knopp added a comment - 05/Dec/06 09:45 PM
Thanks for the tip!

Matej Knopp added a comment - 05/Dec/06 09:46 PM
Also added support for other table elements, opera and inline javascript.

Matej Knopp made changes - 05/Dec/06 09:46 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 2.0 [ 12312113 ]
Fix Version/s 1.2.4 [ 12312138 ]
Resolution Fixed [ 1 ]
Fix Version/s 1.3 [ 12312114 ]
Vincent Demay added a comment - 06/Dec/06 08:29 AM
You're welcome. Yes I forgotten others elements