1

i have the following in my .xhtml JSF:

<h:selectOneMenu id="raceSelector" value="#manageElectionRace.electionRace.race}" converter="#{RaceConverter}" required="true" requiredMessage="Race Selection is required" valueChangeListener="#manageElectionRace.getValueChanges}" onchange="submit()">
    <f:selectItem itemValue="#{null}" itemLabel="--select--" noSelectionOption="true"/>
    <f:selectItems value="#{manageElectionRace.racesNotInElection}" var="race" itemValue="#{race}" itemLabel="#{race.raceName}"/> 
</h:selectOneMenu>

The drop down right now shows the raceName only, however, I need the drop down to show (concatenate) raceName plus 2 more columns from the same table, say col2 and col3 (if col2 and col3 are not Null)

[![the data][1]][1]

The drop Down should have:

  • race1
  • race2 value of Col2: m , value of Col3: n

Note that i also need to display the text in bold value of Col2 and value of Col3 in teh drop down

Thank you , appreciate your time and help.

Jad
  • 13
  • 4
  • Please remove this Comment and edit your Question also use code formatting – Kukeltje Jan 27 '17 at 17:41
  • Regarding the string concatenation, your question is duplicate of http://stackoverflow.com/questions/6297262/how-to-concatenate-a-string-in-el. Parts bold (effectively a new question) is not possible. This is an html limitation, not a jsf one. You need to use e.g. PrimeFaces – Kukeltje Jan 27 '17 at 18:27
  • Possible duplicate of [How to concatenate a String in EL?](http://stackoverflow.com/questions/6297262/how-to-concatenate-a-string-in-el) – Kukeltje Jan 27 '17 at 18:30
  • i'm using facelets and tomhawk, not PrimeFaces, any other suggestion please? – Jad Jan 27 '17 at 19:02

0 Answers0