如何在Richfaces中自定义SKIN?
我想定制我的网络应用程序的整体外观和感觉。 目前我使用的是Richfaces 4.1.0。
第一次试用:
要自定义皮肤,我尝试遵循 http:// /www.packtpub.com/article/skin-customization-in-jboss-richfaces-3.3
- 添加了 mySkin 属性文件。
- 更新了 build.xml
- 更新了 web.xml。
但这一切并没有取得成果。我无法自定义皮肤。
第二次试用:
<context-param> <param-name>org.richfaces.skin</param-name>
<param-value>emeraldTown</param-value> </context-param>
但这也不起作用。为了使其正常工作,我是否需要添加任何额外的资源?
第三次试验:
<rich:tabPanel switchType="client" style="width: 70%;margin: auto;background-color:red;">
<rich:tab header="Overview">
Tab 1 Content
</rich:tab>
<rich:tab header="JSF 2 and RichFaces 4">
Tab 2 Content
</rich:tab>
</rich:tabPanel>
我尝试显式设置背景颜色,但即使这样也失败了。
I want to customize whole look and feel of my web application.
Currently I am using Richfaces 4.1.0.
1st Trial:
To customize the SKIN I tried to follow http://www.packtpub.com/article/skin-customization-in-jboss-richfaces-3.3
- Added mySkin properties file.
- Updated build.xml
- Updated web.xml.
But All this is not fruitful. I am not able to customize the SKIN.
2nd Trial:
<context-param> <param-name>org.richfaces.skin</param-name>
<param-value>emeraldTown</param-value> </context-param>
But this is also not working. To get it working am I required to add any additional RESOURCE?
3rd Trial:
<rich:tabPanel switchType="client" style="width: 70%;margin: auto;background-color:red;">
<rich:tab header="Overview">
Tab 1 Content
</rich:tab>
<rich:tab header="JSF 2 and RichFaces 4">
Tab 2 Content
</rich:tab>
</rich:tabPanel>
I tried to put background color Explicitly, but even this is failing.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以在 Richfaces 中自定义三个级别的皮肤。
使用皮肤属性文件
可以通过改变皮肤中皮肤参数的值来修改应用界面。为此,您需要编辑 Skin.properties 文件中定义的常量值,以更改映射到该外观属性的每个组件的样式。
使用组件样式表
可以修改组件的 ECSS 文件中列出的映射和其他样式属性。编辑 ECSS 文件的内容以更改该类型的所有组件的样式。
使用自定义组件样式类,
您还可以为各个组件指定 styleClass 属性。为此,将新的样式类添加到应用程序 CSS 中,并使用 styleClass 属性从单个组件引用它。
通过在应用程序中覆盖样式表
您还可以加载自定义样式表,使用该样式表重写为组件的样式类定义的扩展样式。
有关详细信息,请参阅 http://docs.jboss.org/richfaces/latest_4_1_X/Developer_Guide/en-US/html/chap-Developer_Guide-Skinning_and_theming.html
You can customize skin in Richfaces at three level.
Using property files of skin
you can modify the Application interfaces by changing the values of skin parameters in the skin. for that you need to Edit the constant values defined in the skin.properties file to change the style of every component mapped to that skin property.
Using Component stylesheets
Mappings and other style attributes listed in a component's ECSS file can be modified. Edit the content of ECSS file to change the styles of all components of that type.
Using Custom components style classes
you can also specify styleClass attribute to Individual components. For that add the new style class to the application CSS and reference it from an individual component with the styleClass attribute.
By Overwriting stylesheets in application
You can also load custom stylesheets using which rewrites of extends styles defined for style classes of components.
for detailed information refer http://docs.jboss.org/richfaces/latest_4_1_X/Developer_Guide/en-US/html/chap-Developer_Guide-Skinning_and_theming.html
我尝试了一些不同的事情,但对于
第一次试验和第二次试验
第二次试验
我找到了解决方案。
web.xml
中缺少,添加上述行后,我开始得到预期的结果。I tried few Different things, but for
1st Trial &
2nd Trial
I found the solution.
was missing in
web.xml
, on adding the above line, I started to get expected results.