You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Igor Vaynberg (JIRA)" <ji...@apache.org> on 2006/12/05 19:18:23 UTC

[jira] Assigned: (WICKET-143) [PATCH]Re-render a table element via AjaxRequestTarget under IE does not works

     [ http://issues.apache.org/jira/browse/WICKET-143?page=all ]

Igor Vaynberg reassigned WICKET-143:
------------------------------------

    Assignee: Matej Knopp

> [PATCH]Re-render a table element via AjaxRequestTarget under IE does not works
> ------------------------------------------------------------------------------
>
>                 Key: WICKET-143
>                 URL: http://issues.apache.org/jira/browse/WICKET-143
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>         Environment: Internet Explorer and AjaxRequestTarget - Wicket1.X and trunk
>            Reporter: vincent Demay
>         Assigned To: Matej Knopp
>         Attachments: patch.txt
>
>
> 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]);       

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira