将styleClass应用于datatable列上的inputText时的问题
CSS:
.sample {
background: red;
}
XHTML
<p:inputText id="inputTxtOnForm" value="hi" styleClass="sample"/>
<p:column id="articleDescription" headerText="Article Description"
filterBy="#{article.description}" filterMatchMode="startsWith">
<p:inputText id="inputTxtOnDataTable" value="#{article.description}"
styleClass="sample" />
</p:column>
inputTxtOnForm
直接放置在表单上. inputTxtOnDataTable
放在数据表的列上.
inputTxtOnForm
is placed on a form directly. inputTxtOnDataTable
is placed on a column of a datatable.
正在应用具有id="inputTxtOnForm"
的inputText
上的styleClass
.但是,styleClass
不会应用于具有id="inputTxtOnDataTable"
的inputText
.在后一种情况下,primefaces的themes.css
属性不会被覆盖.
The styleClass
on the inputText
having id="inputTxtOnForm"
is getting applied. But, styleClass
is not getting applied on the inputText
having id="inputTxtOnDataTable"
. The properties of primefaces' themes.css
are not getting over-ridden in the latter case.
这是一个已知的错误吗?有没有解决的办法.
Is it a known bug ? Is there any workaround for the same.
.sample {
background: red !important;
}
为我工作.可能在primefaces的css中将背景标记为重要.
worked for me. Probably, the background is marked as important in primefaces' css.