1

How can I set the theme of Primefaces mobile. I have set up the Primefaces repo in pom and set up the org.primefaces.themes dependency :

<repositories>
    <repository>
        <id>prime-repo</id>
        <name>Prime Repo</name>
        <url>http://repository.primefaces.org</url>
    </repository>
</repositories>

<dependencies>
    <dependency>  
        <groupId>org.primefaces.themes</groupId>
        <artifactId>all-themes</artifactId>
        <version>1.0.10</version>  
    </dependency>
</dependencies>

I also set primeface.THEME context-param in web.xml :

<context-param>
    <param-name>primefaces.THEME</param-name>
    <param-value>#{usrBean.theme}</param-value>
</context-param>

Here theme is a string which I set to "cupertino" in an @PostConstruct method. This however does not work. Since this is all from Primefaces example/docs and not Primefaces Mobile is there possible something extra I need to do?

Using Primefaces 5.0 and the built in mobile libs.

Vinc
  • 695
  • 2
  • 10
  • 26

1 Answers1

2

Just got it. Found it in the user guide : http://www.primefaces.org/docs/guide/primefaces_user_guide_5_0.pdf page 553

In web.xml just change the context-param to primeface.mobile.THEME :

<context-param>
    <param-name>primefaces.mobile.THEME</param-name>
    <param-value>#{usrBean.theme}</param-value>
</context-param>
Vinc
  • 695
  • 2
  • 10
  • 26
  • do know where to get pre-made PF mobile themes? – Fritz Feb 06 '15 at 08:48
  • In the link in my answer on page 553 it explains how to use themeroller to make themes really easily. Otherwise you can try http://primefaces.org/themes , but those are not normal primefaces themes so I'm not sure they will work. If this doesn't work ask a new question instead of asking questions in comments please. – Vinc Feb 06 '15 at 12:48