) 我在使用primefaces主题时遇到了一个问题... 我有一个XHTML页面包含一个数据表,其中的行根据条件着色。但是在主题“trontastic”的集成之后,所有都丢失了。 我要做什么!请帮帮我 这个我的代码根据条件不显示这种风格
<p:dataTable var="fab" value="#{composantbean.list}"
rowStyleClass="#{fab.statut eq 'Actif' ? 'a' : (fab.statut eq 'Obsolete' ? 'o':(fab.statut eq 'En voi d obsolescence' ? 'e':(fab.statut eq 'Obsolete mais diponible' ? 'or':null)))}">
这是Style不接受!!!
<h:head><style type="text/css">
.a
{
background-color: #00FF00 !important;
font-weight: bold;
}
.o
{
background-color: #FF0000 !important;
font-weight: bold;
}
.e
{
background-color: #FFFF00 !important;
font-weight: bold;
}
.or
{
background-color: #FF9933 !important;
font-weight: bold;
}
</style>
答案 0 :(得分:1)
根据您的浏览器,使用firebug或其他任何内容检查数据表元素。我assum primefaces主题将某些css类附加到组件。如果你想编辑你需要制作基于那些的css类的样式。
默认情况下,css类为.ui-component
尝试将您的css类编辑为.ui-component .o
,依此类推......
记住.ui-component可以是任何东西,所以在firefox中使用firebug或者只是使用chrome中的devloper工具(cntrl shift i)来检查元素css类。
答案 1 :(得分:1)
我们在这里有两个问题:
.ui-state-highlight {
background: linear-gradient(#FFFFFF, #CCEEFF) repeat scroll 0 0 rgba(0, 0, 0, 0) !important;
}