javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2381

Ajax update to body creates undefined attributes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.7
    • Fix Version/s: 2.1.8, 2.2.0-m02
    • Component/s: None
    • Labels:
      None

      Description

      If an Ajax update is applied to the <body> tag, such as

      <partial-response><changes><update id="javax.faces.ViewBody"><![CDATA[<body>...

      the <body> tag will be modified as follows:

      <body class="undefined" title="undefined" lang="undefined" dir="">

      This is due to the attribute cloning implementation in jsf.js

      function cloneAttributes(target, source)

        Activity

        Hide
        tedgoddard added a comment -

        The fix is to modify the attribute detection as follows:

        newValue = source.getAttribute(attributeName);
        oldValue = target.getAttribute(attributeName);

        (rather than using source[attributeName] which returns the String "undefined" rather than a null)

        Show
        tedgoddard added a comment - The fix is to modify the attribute detection as follows: newValue = source.getAttribute(attributeName); oldValue = target.getAttribute(attributeName); (rather than using source [attributeName] which returns the String "undefined" rather than a null)
        Hide
        rogerk added a comment -

        I've verified this issue exists.

        Show
        rogerk added a comment - I've verified this issue exists.
        Hide
        rogerk added a comment -

        Changes.

        Show
        rogerk added a comment - Changes.
        Hide
        rogerk added a comment -

        Committed to MOJARRA_2_1X_ROLLING branch:
        Sending jsf-api/src/main/resources/jsf.js
        Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax/UpdateBean.java
        Adding test/agnostic/ajax/src/main/webapp/updateBody.xhtml
        Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax/Issue2381IT.java
        Transmitting file data ....
        Committed revision 9904.

        Show
        rogerk added a comment - Committed to MOJARRA_2_1X_ROLLING branch: Sending jsf-api/src/main/resources/jsf.js Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax/UpdateBean.java Adding test/agnostic/ajax/src/main/webapp/updateBody.xhtml Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax/Issue2381IT.java Transmitting file data .... Committed revision 9904.
        Hide
        rogerk added a comment -

        Fix versions.

        Show
        rogerk added a comment - Fix versions.
        Hide
        rogerk added a comment -

        Changes for Trunk.

        Show
        rogerk added a comment - Changes for Trunk.
        Hide
        rogerk added a comment -

        Committed to trunk:
        Sending jsf-api/src/main/resources/jsf.js
        Adding test/agnostic/ajax
        Adding test/agnostic/ajax/pom.xml
        Adding test/agnostic/ajax/src
        Adding test/agnostic/ajax/src/main
        Adding test/agnostic/ajax/src/main/java
        Adding test/agnostic/ajax/src/main/java/com
        Adding test/agnostic/ajax/src/main/java/com/sun
        Adding test/agnostic/ajax/src/main/java/com/sun/faces
        Adding test/agnostic/ajax/src/main/java/com/sun/faces/test
        Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic
        Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax
        Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax/UpdateBean.java
        Adding test/agnostic/ajax/src/main/resources
        Adding test/agnostic/ajax/src/main/webapp
        Adding test/agnostic/ajax/src/main/webapp/WEB-INF
        Adding test/agnostic/ajax/src/main/webapp/WEB-INF/web.xml
        Adding test/agnostic/ajax/src/main/webapp/resources
        Adding test/agnostic/ajax/src/main/webapp/updateBody.xhtml
        Adding test/agnostic/ajax/src/test
        Adding test/agnostic/ajax/src/test/java
        Adding test/agnostic/ajax/src/test/java/com
        Adding test/agnostic/ajax/src/test/java/com/sun
        Adding test/agnostic/ajax/src/test/java/com/sun/faces
        Adding test/agnostic/ajax/src/test/java/com/sun/faces/test
        Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic
        Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax
        Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax/Issue2381IT.java
        Sending test/agnostic/pom.xml
        Transmitting file data .......
        Committed revision 9906.

        Show
        rogerk added a comment - Committed to trunk: Sending jsf-api/src/main/resources/jsf.js Adding test/agnostic/ajax Adding test/agnostic/ajax/pom.xml Adding test/agnostic/ajax/src Adding test/agnostic/ajax/src/main Adding test/agnostic/ajax/src/main/java Adding test/agnostic/ajax/src/main/java/com Adding test/agnostic/ajax/src/main/java/com/sun Adding test/agnostic/ajax/src/main/java/com/sun/faces Adding test/agnostic/ajax/src/main/java/com/sun/faces/test Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax Adding test/agnostic/ajax/src/main/java/com/sun/faces/test/agnostic/ajax/UpdateBean.java Adding test/agnostic/ajax/src/main/resources Adding test/agnostic/ajax/src/main/webapp Adding test/agnostic/ajax/src/main/webapp/WEB-INF Adding test/agnostic/ajax/src/main/webapp/WEB-INF/web.xml Adding test/agnostic/ajax/src/main/webapp/resources Adding test/agnostic/ajax/src/main/webapp/updateBody.xhtml Adding test/agnostic/ajax/src/test Adding test/agnostic/ajax/src/test/java Adding test/agnostic/ajax/src/test/java/com Adding test/agnostic/ajax/src/test/java/com/sun Adding test/agnostic/ajax/src/test/java/com/sun/faces Adding test/agnostic/ajax/src/test/java/com/sun/faces/test Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax Adding test/agnostic/ajax/src/test/java/com/sun/faces/test/agnostic/ajax/Issue2381IT.java Sending test/agnostic/pom.xml Transmitting file data ....... Committed revision 9906.
        Hide
        rogerk added a comment -

        Resolved.

        Show
        rogerk added a comment - Resolved.

          People

          • Assignee:
            rogerk
            Reporter:
            tedgoddard
          • Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: