Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-143

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • wicket
    • 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]);

      Attachments

        1. patch.txt
          1 kB
          Vincent Demay

        Activity

          People

            knopp Matej Knopp
            vincent.demay@anyware-tech.com Vincent Demay
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: