使用Primefaces的一些事情

1、怎样应用不同的theme

在primefaces中可以随时使用不同的theme,对于portlet应用也是一样


在 http://repository.primefaces.org/org/primefaces/themes/
下载primefaces社区提供的许多theme,就是一个jar包,放在应用的lib下
然后在web.xml中加入:
< context-param ]]>
        
< param-name ]]> primefaces.THEME param-name ]]>
        
< param-value ]]> afterdark param-value ]]>
  
context-param ]]>
其中 > after dark是theme的名字
实际上就是下载的jar包的名字,不包括版本号

重新发布就可以了

在theme名字的位置可以使用EL表达式,例如:

#{hello.theme}

这样就可以随时更换theme了

需要将bean设置为SessionScoped

也可以开发自己的theme

通过ThemeRoller在线工具生成theme,然后将下载的zip包转换为prime faces的theme格式。具体方法参见prime faces的用户手册。
http://themeroller.jquerymobile.com

你可能感兴趣的:(使用Primefaces的一些事情)