PrimeFaces #1759 Reproducer
This project is a reproducer for PrimeFaces #1759: Unecessary non-mobile resources loaded when navigating to PrimeFaces mobile view via Ajax
-
Clone the reproducer project:
git clone https://github.com/stiemannkj1/primefaces-mobile-ajax-resources-issue-reproducer
-
Build the project with maven:
cd primefaces-mobile-ajax-resources-issue-reproducer && mvn clean install
-
Deploy the project to tomcat:
cp target/primefaces-mobile-ajax-resources-issue-reproducer*.war $TOMCAT_HOME/webapps/
-
Navigate to
index.xhtml
(http://localhost:8080/primefaces-mobile-ajax-resources-issue-reproducer-1.0-SNAPSHOT/faces/index.xhtml). -
Right click on the page and select Inspect Element.
-
Click on the Network tab to see what resources are loaded.
-
Click the page2
h:commandButton
.
If the bug still exists, then components.js
will be loaded via GET
. If the bug is fixed, then components.js
and all other non-mobile resources will not be loaded.
-
During a non-ajax request, non-mobile resources are suppressed by the PrimeFaces mobile
HeadRenderer
:if(library != null && library.equals("primefaces")) { String resourceName = (String) attrs.get("name"); if(resourceName.startsWith("jquery") || resourceName.startsWith("primefaces") || resourceName.startsWith("components") || resourceName.startsWith("core")) { shouldRender = false; } }
-
This bug only occurs when navigating from pages which do not contain
components-mobile.js
orcomponents.js
already. -
This bug causes JS errors in a portlet environment.
-
This issue only occurs on PrimeFaces 6.0. This issue does not occur with PrimeFaces
5.3
and below.