jsf - Applying Theme in Primefaces 5.1 via primefaces.THEME doesn't work -
i trying downloaded dark-hive themeroller theme primefaces project going can't figure out why won't show...looking html source code see aristo theme, believe default primefaces theme. followed multiple forum suggestions have post 1 community - maybe can give me hint.
project structure: /webapp/web-inf/lib/dark-hive.jar -> downloaded themeroller.org , converted themeroller.osnode.com/themeroller pf theme /webapp/web-inf/templates/layout.xhtml -> master template, contains xmlns:h="http://java.sun.com/jsf/html" namespace attribute tag /webapp/web-inf/resources /webapp/web-inf/web.xml /webapp/web-inf/faces-config.xml ...i don't output css because according docs it's not needed pf themes work.
parts of web.xml:<context-param> <param-name>javax.faces.webapp_resources_directory</param-name> <param-value>/web-inf/resources</param-value> </context-param> <context-param> <param-name>primefaces.theme</param-name> <param-value>dark-hive</param-value> </context-param>
please note moved resources folder web-inf/.
parts of pom.xml:<dependency> <groupid>org.primefaces.themes</groupid> <artifactid>dark-hive</artifactid> <version>1.0.8</version> </dependency>
because of maven dependency , manual download/drop /web-inf/lib folder have 2 dark-hive.jar in war file:
/web-inf/lib/dark-hive-1.0.8.jar /web-inf/lib/dark-hive.jarboth have same internal structure.
i using wildfly 8.1.0.final upgraded jsf mojarra 2.2.8, primefaces 5.1, omnifaces 1.8.1
any ideas?
the reply lies within utilize of omnifaces showcase headrenderer.
in faces-config.xml using:
<render-kit> <renderer> <component-family>javax.faces.output</component-family> <renderer-type>javax.faces.head</renderer-type> <renderer-class>org.omnifaces.showcase.headrenderer</renderer-class> </renderer> </render-kit>
which used primefaces-aristo theme. solution write own headrenderer according to:
custom headrenderer
jsf primefaces themeroller
No comments:
Post a Comment