2013-01-01 40 views
0

可能重複:
Bold second item of a selectOneMenu如何爲tr單個項目着色:selectOneChoice?

是否有可能油漆/顏色項目在選擇項目下拉?

我的代碼:

<tr:selectOneChoice value="#{bean.entity}> 
    <f:selectItems value="#{bean.entities}" /> 
</tr:selectOneChoice> 

支持bean:

public List<SelectItem> getEntities() { 
    List<SelectItem> entities = new ArrayList(); 
    SelectItem item = new SelectItem(); 
    item.setValue("value"); 
    item.setLabel("label"); 
    entities.add(item); 
} 

我要的styleClass添加到該項目。任何人都知道如何做到這一點?

回答

0

不,通常這是不可能的,它的渲染取決於瀏覽器。
如果絕對必要,您將不得不創建一個<div>,並將其設置爲下拉式。