ICEfaces
  1. ICEfaces
  2. ICE-9874

HTML script tag's are not rendered on the page after an update

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: EE-3.3.0.GA_P01, EE-3.3.0.GA_P02
    • Fix Version/s: None
    • Component/s: Bridge
    • Labels:
      None
    • Environment:
      All
    • Assignee Priority:
      P2

      Description

      If there are <script> tags included in the body of a page, and the tag is included in an update (hiding/showing of a panel for example). When the page is rendered the script tag is no longer rendered on the page even though it is seen in the response.

        Activity

        Hide
        Arran Mccullough added a comment -

        Attached test case that shows this behavior. The icefaces-*.jar files need to be added into the war file.

        Steps:

        • Load test.jsf
        • Click the Hide button
        • Click the Show button
        • Looking at the rendered source, the script tag that should be rendered in the body-> scriptPnl div tag is no longer there.

        Reviewing the updates the script tag is included but not rendered.

        Note: for this instance a workaround is to surround the section that is being hidden/shown in a div but this isn't a solution for the customers app.

        Show
        Arran Mccullough added a comment - Attached test case that shows this behavior. The icefaces-*.jar files need to be added into the war file. Steps: Load test.jsf Click the Hide button Click the Show button Looking at the rendered source, the script tag that should be rendered in the body-> scriptPnl div tag is no longer there. Reviewing the updates the script tag is included but not rendered. Note: for this instance a workaround is to surround the section that is being hidden/shown in a div but this isn't a solution for the customers app.
        Hide
        Mircea Toma added a comment -

        During a partial update Mojarra (or Myfaces) will strip out all the script tags found in the update. Once collected the script code is evaluated using eval function but only after the DOM was modified by the update's markup (which does not contain the script tags anymore). The reason for this procedure is to normalize the behaviour of the the browsers since some will evaluate natively the script tags inserted into the DOM and some will not.

        When running the provided test case it can be verified (using browser's JS console) that after clicking the Show button the function defined in the script tag openAlertWindow was indeed evaluated.

        Show
        Mircea Toma added a comment - During a partial update Mojarra (or Myfaces) will strip out all the script tags found in the update. Once collected the script code is evaluated using eval function but only after the DOM was modified by the update's markup (which does not contain the script tags anymore). The reason for this procedure is to normalize the behaviour of the the browsers since some will evaluate natively the script tags inserted into the DOM and some will not. When running the provided test case it can be verified (using browser's JS console) that after clicking the Show button the function defined in the script tag openAlertWindow was indeed evaluated.

          People

          • Assignee:
            Mircea Toma
            Reporter:
            Arran Mccullough
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: