使用以下代码时:
<p:commandButton value="New" icon="ui-ribbonicon-new" styleClass="ui-ribbon-bigbutton" type="button"/>
不显示图标ui-ribbonicon-new!
我在glassfish 3.1上使用Primefaces 5.1和jsf 2.1。 有人可以帮忙吗。
答案 0 :(得分:2)
您必须在页面中添加样式,如下面的css。
<style type="text/css">
.ui-ribbon .ui-colorpicker .ui-button {
height: 24px;
}
.ui-icon.ui-ribbonicon-new {
margin-left: -10px;
margin-top: -20px;
background-image: url("#{resource['demo/images/icon/new.png']}");
}
.ui-icon.ui-ribbonicon-save {
background-image: url("#{resource['demo/images/icon/save.png']}");
}
.ui-icon.ui-ribbonicon-paste {
background-image: url("#{resource['demo/images/icon/paste.png']}");
}
.ui-icon.ui-ribbonicon-cut {
background-image: url("#{resource['demo/images/icon/cut.png']}");
}
.ui-icon.ui-ribbonicon-print {
background-image: url("#{resource['demo/images/icon/print.png']}");
}
.ui-icon.ui-ribbonicon-zoomin {
background-image: url("#{resource['demo/images/icon/zoomin.png']}");
}
.ui-icon.ui-ribbonicon-zoomout {
background-image: url("#{resource['demo/images/icon/zoomout.png']}");
}
</style>
您可以从primefaces repository下载所有图片。