我想要將特定於<f:selectItem>
的CSS應用於<h:selectOneMenu>
,以便以不同的樣式顯示。將CSS應用於嵌套在<h:selectOneMenu>中的<f:selectItem>
例如我希望下面列表中的每個咖啡選項都以不同的顏色顯示。
<h:selectOneMenu value="#{user.favCoffee1}">
<f:selectItem itemValue="Cream Latte" itemLabel="Coffee3 - Cream Latte" />
<f:selectItem itemValue="Extreme Mocha" itemLabel="Coffee3 - Extreme Mocha" />
<f:selectItem itemValue="Buena Vista" itemLabel="Coffee3 - Buena Vista" />
</h:selectOneMenu>`
任何人都可以幫助我嗎?
'h:selectOneRadio'呢?我有一個要求,其中有3個選項,每個選項都有不同的顏色標籤。不能找到一種方式來與jsf中的無線電做到這一點。它似乎是在每個單元格中以''和一個匹配的'
@Lucas:http://stackoverflow.com/questions/6033955/jsf-more-customizable-selectmanycheckbox-and-selectoneradio – BalusC
謝謝,這將工作,但我們目前沒有使用戰斧。我將不得不看到,如果這可以添加到我們的環境沒有負面後果(看起來像太多的框架是一件壞事)。無論如何,我發現一個hackish的方式來使用默認jsf: '' css: '.choices input [value =「yes」] + label {color:green} .choices input [value =「no」] +標籤{color:red}' –
Lucas