This discussion is archived
3 Replies Latest reply: Aug 2, 2012 3:47 AM by gimbal2 RSS

how to change css of f:selectItems

801890 Newbie
Currently Being Moderated
Hello

I am not able to change the css of f:selectItems inside rich:select. I can change CSS of rich:Select successfully unfortunately I do fail when I try to change f:selectItem. You can see the code.. Any help will be appreciated.

Best Regards
Altaico

<code>

<h:panelGroup styleClass="mySelectStyle" rendered="#{loginBean.isAuthorize('sigorta') or loginBean.isAuthorize('admin')}" >
<rich:select id="kurumList" enableManualInput="true"
value="#{loginBean.islemYapilanKurum.kurumKodu}"
defaultLabel=" " rendered="#{not empty kurumListTemp}" styleClass="mySelectStyle" >
<f:selectItems value="#{kurumListTemp}" var="k"
itemLabel="#{k.kurumAdi}" itemValue="#{k.kurumKodu}" styleClass="mySelectStyle" />
<f:ajax event="change" render="toolbar" listener="#{loginBean.kurumAta}"/>
</rich:select>
</h:panelGroup>

</code>
  • 1. Re: how to change css of f:selectItems
    gimbal2 Guru
    Currently Being Moderated
    Yes, if you would check the JSF specifications or any result you get by searching google for 'jsf tags' you would see that f:selectItem in fact does not support a styleClass attribute. In stead of just guessing - look up specs and know. Surely that is not a weird concept to you?

    But then you're using Richfaces - and this is not a Richfaces forum. But I'm a nice guy (really!) so I check the Richfaces manual for you - which you could have done yourself. And then I see that the rich:comboBox element supports an 'itemClass', an 'itemSelectedClass' and a 'listClass' attribute. 2 minutes of work. Might be worth investigating.

    Good luck.
  • 2. Re: how to change css of f:selectItems
    801890 Newbie
    Currently Being Moderated
    gimbal


    My richfaces version does not support rich:comboBox... Unfortunately, I am not able to use rich:comboBox ... : ((
  • 3. Re: how to change css of f:selectItems
    gimbal2 Guru
    Currently Being Moderated
    Too bad, better drop the requirement then. A little knowledge of the working environment, which is HTML and CSS in this case, would have told you that there actually are little to none styling choices for select options.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points