我已经看到类似的问题
here和
here.这两个都没有回答我的问题.我也搜索了
PrimeFaces forum.
在NetBeans中设置一个香草JSF 2.0项目,我添加了Simple Dialog的Showcase代码.
代码(index.xhtml)减去xml声明和DOCTYPE(XHTML 1.0 Transitional):
- <html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:h="http://java.sun.com/jsf/html"
- xmlns:p="http://primefaces.prime.com.tr/ui">
- <h:head>
- <title>PrimeFaces</title>
- </h:head>
- <h:body>
- <h:panelGrid columns="1" cellpadding="5">
- <p:commandButton value="Basic" onclick="dlg1.show();" type="button"/>
- <p:commandButton value="Modal" onclick="dlg2.show();" type="button"/>
- <p:commandButton value="Effects" onclick="dlg3.show();" type="button"/>
- </h:panelGrid>
- <p:dialog header="Basic Dialog" widgetVar="dlg1">
- <h:outputText value="Resistance to PrimeFaces is futile!" />
- </p:dialog>
- <p:dialog header="Modal Dialog" widgetVar="dlg2" modal="true" height="200">
- <h:outputText value="This is a Modal Dialog." />
- </p:dialog>
- <p:dialog header="Effect Dialog" widgetVar="dlg3" showEffect="bounce" hideEffect="explode" height="200">
- <h:outputText value="This dialog has cool effects." />
- </p:dialog>
- </h:body>@H_403_7@
我将aristo主题添加到我的Libraries(NetBeans添加到classpath中),并将以下内容添加到web.xml
web.xml(部分):
<context-param>
<param-name>primefaces.THEME</param-name> <param-value>aristo</param-value> </context-param>@H_403_7@没有其他更改,虽然我很快安装/卸载另一个主题(黑暗蜂巢),只是为了确保主题正在注册正确.结果如下:
本地(Chrome 15.0.874.92):
展示:(从PrimeFaces Showcase)
堆栈:
PrimeFaces 2.2.1
JSF 2.0
玻璃鱼3.1.1
Java 1.6.0_18
Windows 7 x64
(由NetBeans 7.0.1生成)编辑:这也是在FireFox 7.0.1和IE 9上测试的
解决方法
默认字体大小不是问题吗?从
showcase css可以看出,它有自定义字体大小覆盖主题的默认值:
- body {
- margin: 0px;
- padding: 0;
- font-size: 12px;
- color: #616161;
- }@H_403_7@
我查了一些我的项目,他们都有一些font-size / font-family定制.希望有帮助