1

如何设置 Primefaces mobile 的主题。我已经在 pom 中设置了 Primefaces 存储库并设置了 org.primefaces.themes 依赖项:

<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>

我还在 web.xml 中设置了 primeface.THEME 上下文参数:

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

这里的主题是我在@PostConstruct 方法中设置为“cupertino”的字符串。然而,这不起作用。由于这全部来自 Primefaces 示例/文档,而不是 Primefaces Mobile,我可能需要做一些额外的事情吗?

使用 Primefaces 5.0 和内置的移动库。

4

1 回答 1

2

刚刚得到它。在用户指南中找到它:http: //www.primefaces.org/docs/guide/primefaces_user_guide_5_0.pdf第 553 页

在 web.xml 中,只需将 context-param 更改为 primeface.mobile.THEME :

<context-param>
    <param-name>primefaces.mobile.THEME</param-name>
    <param-value>#{usrBean.theme}</param-value>
</context-param>
于 2014-09-01T07:51:11.477 回答