how to set a PrimeFaces theme? I have downloaded a aristo-1.0.0 jar and added the following code in web.xml file .
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>aristo</param-value>
</context-param>
but not working!Any idea?
set a PrimeFaces theme
I have a quite similar problem with PF 3.0 M4. I am using my own theme and it seems it's broken in M4 because it works fine on M2 and M3.
Code: Select all
<!-- <context-param>
<param-name>primefaces.THEME</param-name>
<param-value>none</param-value>
</context-param> -->
Please try theme version 1.0.1 (not 1.0.0) for 3.0 M release
PrimeFaces 3.4, Seam Faces 3.0.2.Final, Glassfish v3.1, Mojarra 2.1.10, NetBeans 7.2, Hibernate JPA 2.0, Seam Persistence 3.0.0.Final Theme default HOT-SNEAKS
-
- PrimeFaces Core Developer
- Posts: 3979
- Joined: 03 Dec 2010, 14:11
- Location: Bavaria, DE
- Contact:
@jguerra, I created an issue yesterday: http://code.google.com/p/primefaces/iss ... il?id=2696
Thomas Andraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
PrimeFaces | PrimeFaces Extensions
Apache Member | OpenWebBeans, DeltaSpike, MyFaces, BVal, TomEE
Sponsor me: https://github.com/sponsors/tandraschko
Blog: http://tandraschko.blogspot.de/
Twitter: https://twitter.com/TAndraschko
- undermensch
- Posts: 140
- Joined: 08 Jul 2010, 14:37
- Location: Florida, United States
I had the same problem, but got it to work with this:
if you look at the head renderer, you see that the theme loaded would then be primefaces-{whateverStringyourBeanReturns}/theme.css. So I no longer specify a theme in on my page: it's now set by head renderer using value supplied by my bean (<param-value>#{preferences.theme.name}</param-value>).
org.primefaces.renderkit.HeadRenderer (excerpt)
I assume that if you completely leave out the primefaces.THEME param, theme will default to aristo.
Code: Select all
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>#{preferences.theme.name}</param-value>
</context-param>
org.primefaces.renderkit.HeadRenderer (excerpt)
Code: Select all
String theme = "aristo";
String themeParamValue = context.getExternalContext().getInitParameter(Constants.THEME_PARAM);
if(themeParamValue != null) {
ELContext elContext = context.getELContext();
ExpressionFactory expressionFactory = context.getApplication().getExpressionFactory();
ValueExpression ve = expressionFactory.createValueExpression(elContext, themeParamValue, String.class);
theme = (String) ve.getValue(elContext);
}
encodeTheme(context, "primefaces-" + theme, "theme.css");
PrimeFaces-11.0.6 / Wildfly 24
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
"none" keyword support enabled again, this was a regression after setting default theme to aristo, thanks!
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
By the way if you use your own theme, I suggest creating it following PF theme conventions so you can swap easily.
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 16 guests