Details
-
Type: Bug
-
Status: Closed
-
Priority: 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.
-
Hide
- Case12606Example2.war
- 3.50 MB
- Arran Mccullough
-
- META-INF/MANIFEST.MF 0.1 kB
- META-INF/context.xml 0.1 kB
- WEB-INF/classes/TestBean$1.class 1 kB
- WEB-INF/classes/TestBean.class 2 kB
- WEB-INF/lib/commons-beanutils.jar 226 kB
- WEB-INF/lib/commons-collections.jar 558 kB
- WEB-INF/lib/commons-digester.jar 140 kB
- WEB-INF/lib/commons-logging.jar 52 kB
- WEB-INF/lib/javax.faces.jar 2.53 MB
- WEB-INF/web.xml 2 kB
- header.xhtml 0.6 kB
- index.xhtml 0.5 kB
- template.xhtml 0.6 kB
- test.xhtml 0.9 kB
-
Hide
- Case12606Example2.zip
- 20 kB
- Arran Mccullough
-
- Case12606Example2/build.xml 3 kB
- Case12606Example2/.../ant-deploy.xml 3 kB
- Case12606Example2/.../build-impl.xml 77 kB
- Case12606Example2/.../genfiles.properties 0.5 kB
- Case12606Example2/.../private.properties 0.6 kB
- Case12606Example2/nbproject/.../private.xml 0.2 kB
- Case12606Example2/.../project.properties 3 kB
- Case12606Example2/nbproject/project.xml 0.9 kB
- Case12606Example2/src/conf/MANIFEST.MF 0.0 kB
- Case12606Example2/src/java/TestBean.java 1 kB
- Case12606Example2/web/header.xhtml 0.6 kB
- Case12606Example2/web/index.xhtml 0.5 kB
- Case12606Example2/web/.../context.xml 0.1 kB
- Case12606Example2/web/template.xhtml 0.6 kB
- Case12606Example2/web/test.xhtml 0.9 kB
- Case12606Example2/web/WEB-INF/web.xml 2 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
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.
Attached test case that shows this behavior. The icefaces-*.jar files need to be added into the war file.
Steps:
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.