[ 
https://issues.apache.org/jira/browse/WICKET-3606?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018299#comment-13018299
 ] 

Martin Grigorov commented on WICKET-3606:
-----------------------------------------

Hi Pedro.

I use locally this patch:


Index: wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js
===================================================================
--- wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js     
(revision 1090954)
+++ wicket-core/src/main/java/org/apache/wicket/ajax/wicket-ajax.js     
(working copy)
@@ -206,7 +206,12 @@
                        Wicket.Log.error("Wicket.replaceOuterHtmlIE: " + e + ": 
eval -> " + script);
                }
                return;
-       }  
+       } else if (element.tagName == "TITLE") {
+               // match the text between the tags 
+               var titleText = />(.*?)</.exec(text)[1];
+               document.title = titleText;
+               return;
+       }
        
        var parent = element.parentNode;
        var tn = element.tagName;
@@ -276,7 +281,9 @@
        if(element.style.backgroundImage)
                element.style.backgroundImage = "";
        parent.removeChild(element);
-       element.outerHTML = ""; 
+       try {
+               element.outerHTML = "";
+       } catch (ignore) {}
        element = "";

and it solves the problem.
I welcome for better solutions!

> wicket-ajax.js replaceOuterhtmlIE() fails when the page title has to be 
> updated with Ajax
> -----------------------------------------------------------------------------------------
>
>                 Key: WICKET-3606
>                 URL: https://issues.apache.org/jira/browse/WICKET-3606
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 1.5-RC3
>         Environment: IE
>            Reporter: Martin Grigorov
>            Assignee: Martin Grigorov
>
> If the page title is a component in the hierarchy, i.e.
> .html:
> <title wicket:id="title">...</title>
> .java:
> final Label title = new Label("title", someModel);
> and we try to update the 'title' with Ajax then replaceOuterhtmlIE() will 
> fail when trying to set title's element outerHTML to "" (line 284) because 
> outerHTML is read-only for title and several other elements 
> (http://msdn.microsoft.com/en-us/library/aa752326(v=vs.85).aspx).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to