3 Replies Latest reply on Apr 12, 2007 8:57 AM by Pete Muir

    Style on individual selectItem?

    John Chesher Newbie

      I'm using the Seam selectItems tag and would like to conditionally assign a style to SOME of the select items to display their label in red text. Thus far, I haven't found a way to do this using either the Seam selectItems tag or the JSF selectItem tag(s). So, I'm thinking it may be a limitation of JSF and possibly one that Seam SelectItems does not help us overcome. Of course, I don't know what I don't know, so I'm hoping there is a solution that I am just not aware of. Does anyone have a solution for how this can be done using either the Seam selectItems tag or JSF selectItem(s) tags?

      Probably not needed in this case, but here's a code snippet:

      <h:selectManyListbox style="errorMessage" id="selInst" value="#{newUser.institutionChangesList}" size="10" rendered="#{not empty foundInstitutions}">
       <si:selectItems value="#{foundInstitutions}" var="i" label="#{ i.id} - #{i.active ? '' : 'INACTIVE: '}#{i.name} (#{i.state.shortName}, #{i.type.name})" />

      I'd like to add red color to the entries to which I'm currently adding "INACTIVE" to the label.