[英]How do i change the background-color of my dataTable header in Java using JSF Framework?
I'm using JSF 2.1 with Primefaces 4.0 on Glassfish 3.2.1. 我在Glassfish 3.2.1上将JSF 2.1与Primefaces 4.0一起使用。
In my default.css file, I have this code: 在我的default.css文件中,我有以下代码:
.facetHeaderUM .ui-datatable-header {
background-color: transparent !important;
border: none !important;
}
Below is the code Im using in my xhtml file. 以下是我在xhtml文件中使用的代码。
<p:dataTable id="items" var="item" value="#{EmailRcpts.listsofEmail}"
style="width:400px; text-align:left; font-size:12px;"
styleClass="facetHeaderUM"
widgetVar="itemWidVar"
paginator="true" paginatorPosition="bottom"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
currentPageReportTemplate="{totalRecords} record(s) in {totalPages} page(s)"
rows="10">
<f:facet name="header">
<p:outputPanel style="font-style: italic; font-weight: bold; " >
<p:inputText id="globalFilter" style="width:150px;margin-left: -53%"
value="#{EmailRcpts.search}" />  
<p:commandButton id="filterBtn" icon="ui-icon-search"
style="font-style: italic;"/>
<p/>
</p:outputPanel>
</f:facet>
In my p:dataTable I'm using styleClass=facetHeaderUM
. 在我的p:dataTable中,我使用的是
styleClass=facetHeaderUM
。 I want to achieve transparent background-color and border-color in my dataTable header. 我想在dataTable标头中实现透明的background-color和border-color。
Using facetHeaderUm styleClass doesn't work. 使用facetHeaderUm styleClass不起作用。 Default background-color of my p:dataTable header which is red still reigns.
我的p:dataTable标头的默认背景色仍然是红色。
Default.css file is attached correctly. Default.css文件已正确附加。 It has many attributes and its working except to the attribute I have written above.
除了上面我写的属性外,它还有许多属性及其工作方式。
Depending on the primefaces theme you are using, I've found you also have to override the background-image
property. 根据您使用的primefaces主题,我发现您还必须覆盖
background-image
属性。
.facetHeaderUM .ui-datatable-header {
background-color: transparent !important;
border: none !important;
background-image: none !important;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.