Javascript Primefaces:如何更改日历字段按钮上的默认图标?

Javascript Primefaces:如何更改日历字段按钮上的默认图标?,javascript,jquery,css,jsf,primefaces,Javascript,Jquery,Css,Jsf,Primefaces,在Primefaces中,如何更改日历字段按钮使用的图标 例如,在以下字段中 <p:calendar value="#{calendarBean.date3}" id="popupButtonCal" showOn="button" /> 问题: 我现在确实看到了p:commandButton按钮上的图像。但是,我得到了警告信息: 2012年4月3日上午10:43:58 com.sun.faces.application.resource.ResourceHandlerImpl l

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

例如,在以下字段中

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

  • 我现在确实看到了
    p:commandButton
    按钮上的图像。但是,我得到了警告信息:

    2012年4月3日上午10:43:58 com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
    警告:JSF1064:无法找到或提供资源、图像/country\u flag.gif.jsf。

  • 我在
    p:calendar
    上找不到css样式,为了更改calendar按钮上的图像,我应该覆盖该样式

  • 试试这个

    .ui-icon-calendar {
        background-image: <your URL> !important;
        background-position: center center !important;
        width: 16px;
        height: 16px;
    }
    
    .ui图标日历{
    背景图像:!重要;
    背景位置:中-中!重要;
    宽度:16px;
    高度:16px;
    }
    
    用手帕替换默认图像。但是我不想更改primefaces jar。@Cagatay Civici您能提供一个示例/链接吗?谢谢。这个方法怎么样?你用css文件中的el表达式试过了,但是做不到。。。在链接中,他们使用jquery来完成这项工作。。。
    .ui-widget .ui-calendar {
    
        background-image: url(#{resource['images:country_flag.gif']});
    }
    
    .ui-icon-calendar {
        background-image: <your URL> !important;
        background-position: center center !important;
        width: 16px;
        height: 16px;
    }