Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0
    • Fix Version/s: None
    • Component/s: Ajax/JavaScript
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Macintosh

    • Issuezilla Id:
      552
    • Status Whiteboard:
      Hide

      cat2 frame jsdoc size_medium importance_large

      Show
      cat2 frame jsdoc size_medium importance_large

      Description

      This request actually came in from the myfaces folks who are implemented a jsf 2
      ajax solution (following spec):

      When developing the AJAX part of MyFaces 2.0 we encountered 2 locations within
      the jsdoc part of the spec we'd propose for enhancement.

      The first is about the hidden inputs for view state: The jsdocs for
      jsf.ajax.response imply that each hidden input receives the id
      "javax.faces.ViewState" which would result in multiple hidden inputs with this
      id in a multi form document. This is how Mojarra is currently working things
      out, but other implementations should get a chance to use a w3c conformant
      approach - the hidden inputs don't need ids at all, but only
      name=javax.faces.ViewState. A comment on this was already posted by Werner Punz.

      The second is about replacing the body section of a document if the server sends
      the id javax.faces.ViewRoot: The jsdocs for jsf.ajax.response say that the impl
      should >>extract the contents of the <body> element from the <update> element's
      CDATA content and replace the document's <body> section with this contents<<.
      According to this the attributes of the body element wouldn't be replaced with
      the new attributes, which probably isn't the intended behaviour. Preserving the
      attributes can either be achieved by copying them or by using
      contextualRagen/adjacentHTML instead of innerHTML.

      Here is a proposal for changing the jsdocs for jsf.ajax.response to enable both
      enhancements mentioned above - please correct the jsdoc for <static>
      jsf.ajax.response(request, context)
      like this:

      If an update element is found in the response with the identifier
      javax.faces.ViewRoot:

      <update id="javax.faces.ViewRoot">
      <![CDATA[...]]>
      </update>

      Update the entire DOM as follows:

      • Extract the CDATA content and trim the <html> and </html> from the CDATA
        content if it is present.

      <<<<<<< (remove the following lines)

      • If the CDATA content contains a <head> element, and the document has a
        <head> section, extract the contents of the <head> element from the <update>
        element's CDATA content and replace the document's <head> section with this
        contents.
      • If the CDATA content contains a <body> element, and the document has a
        <body> section, extract the contents of the <body> element from the <update>
        element's CDATA content and replace the document's <body> section with this
        contents.

      ======= (add the following lines)

      • If the CDATA content contains a <head> element, and the document has a
        <head> section, replace the document's <head> section with the <head> section
        contained within the CDATA content.
      • If the CDATA content contains a <body> element, and the document has a
        <body> section, replace the document's <body> section with the <body> section
        contained within the CDATA content.

      >>>>>>>

      • If the CDATA content does not contain a <body> element, replace the
        document's <body> section with the CDATA contents.

      If an update element is found in the response with the identifier
      javax.faces.ViewState:

      <update id="javax.faces.ViewState">
      <![CDATA[...]]>
      </update>

      Include this state in the document as follows:

      • Extract this <update> element's CDATA contents from the response.

      <<<<<< (remove the following lines)

      • If the document contains an element with the identifier
        javax.faces.ViewState replace its contents with the CDATA
        contents.
      • For each <form> element in the document:
        o If the <form> element contains an <input> element with
        the identifier javax.faces.ViewState, replace the
        <input> element contents with the <update> element's
        CDATA contents.
        o If the <form> element does not contain an element with the
        identifier javax.faces.ViewState, create an <input>
        element of the type hidden, with the identifier
        javax.faces.ViewState, set its contents to the <update>
        element's CDATA contents, and add the <input> element as
        a child to the <form> element.

      ======= (add the following lines)

      • Set the value of all elements within the document with the name
        javax.faces.ViewState to the CDATA contents
      • Perform the following optionally, implementations my omit this to enhance
        performance, as it enforces a search within the DOM tree. For each <form>
        element in the document:
        o If the <form> element does not contain an element with the
        name javax.faces.ViewState, create an <input> element of
        the type hidden, with the name javax.faces.ViewState,
        set its value to the <update> element's CDATA contents,
        and add the <input> element as a child to the <form>
        element.

      >>>>>>>

      Best Regards,
      Ganesh Jung

        Issue Links

          Activity

          Hide
          rogerk added a comment -

          2.1_gf31_m5

          Show
          rogerk added a comment - 2.1_gf31_m5
          Hide
          rogerk added a comment -

          For now re-target for 2.2.
          If time permits may revisit for 2.1.

          Show
          rogerk added a comment - For now re-target for 2.2. If time permits may revisit for 2.1.
          Hide
          rogerk added a comment -

          triage

          Show
          rogerk added a comment - triage
          Hide
          Ed Burns added a comment -

          Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.

          Show
          Ed Burns added a comment - Set priority to baseline ahead of JSF 2.3 triage. Priorities will be assigned accurately after this exercise.
          Hide
          Ed Burns added a comment -

          Leave priority unchanged.

          Show
          Ed Burns added a comment - Leave priority unchanged.

            People

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

              Dates

              • Created:
                Updated: