0

重複の可能性:
selectOneMenu の太字の 2 番目の項目

選択項目のドロップダウンでアイテムをペイント/色付けすることはできますか?

私のコード:

<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);
}

アイテムにスタイルクラスを追加したい。誰もそれを行う方法を知っていますか?

4

1 に答える 1

0

いいえ、通常それは不可能であり、そのレンダリングはブラウザーに依存します。
絶対に必要な場合は、 を作成し、<div>ドロップダウンのようにスタイルを設定する必要があります。

于 2013-01-01T08:08:09.803 に答える