Primefaces:如何更改日历字段按钮上的默认图标? [英] Primefaces: how to change the default icon on the button of the calendar field?

查看:509
本文介绍了Primefaces:如何更改日历字段按钮上的默认图标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Primefaces中,如何更改日历字段按钮正在使用的图标?

In Primefaces, how do I change the icon that is being used by the button of the calendar field?

例如,在以下字段中

<p:calendar value="#{calendarBean.date3}" id="popupButtonCal" showOn="button" />

我想将图标更改为 http://forum.primefaces.org/images/smilies/icon_e_wink.gif

我查看了文档,但我不能找到此属性。

I've looked at the documentation, but I cannot find an attribute for this.

UPDATE:

,部分成功:

JSF:

<p:commandButton id="modalDialogButton" value="" onclick="dlg2.show();" type="button" icon="ui-calendar"/>

CSS:

.ui-widget .ui-calendar {

    background-image: url(#{resource['images:country_flag.gif']});
}

问题: b


  1. 我现在看到 p:commandButton 按钮上的图片。但是,我收到警告消息:

  1. I do see the image on the p:commandButton button now. But, I am getting the warning message:

2012年4月03日上午10:43:58 com.sun.faces.application.resource。 ResourceHandlerImpl logMissingResource
警告:JSF1064:无法找到或提供资源,images / country_flag.gif.jsf。

我无法在 p:calendar 上找到一个css样式,我应该覆盖它以更改日历按钮上的图像。

I could not find a css style on the p:calendar that I should override in order to change the image on the calendar button.


推荐答案

试试这个

.ui-icon-calendar {
    background-image: <your URL> !important;
    background-position: center center !important;
    width: 16px;
    height: 16px;
}

这篇关于Primefaces:如何更改日历字段按钮上的默认图标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆