【发布时间】:2015-05-11 13:47:33
【问题描述】:
如何在 primefaces 中为 selectOneMenu 设置颜色?
<p:selectOneMenu id="col" value="#{projectsController.selected.listColor}">
<f:selectItem itemLabel="Activity" itemValue="1" class="redBackGroundColor"/>
<f:selectItem itemLabel="Activity1" itemValue="2" class="blueBackGroundColor"/>
<f:selectItem itemLabel="Activity2" itemValue="3" class="greenBackGroundColor"/>
</p:selectOneMenu>
这是我的 CSS
.redBackGroundColor{
background-color:red;
}
(当然还有蓝色和绿色..) 但它不影响primeface的行为。
【问题讨论】:
-
PrimeFaces 4.0 中似乎有一个解决方法。也许这仍然有效:stackoverflow.com/questions/19403631/…
-
这不是一种解决方法,但 PrimeFaces 的高级显示方式仍然有效。见primefaces.org/showcase/ui/input/oneMenu.xhtml
标签: css jsf primefaces