Showing a JSF page, with a selectOneMenu component that lists every item of a enum class. This Enum class corresponds to cities.
Problem is that I want to show one field that says "All Cities", as I'm showing a *List<City>*
I can't add the "All Cities" value because that would be a String.
So actual items being showed in the SelectOneMenu is e.g.:
NYC, San Francisco, Rome, Paris
And the desired output would be:
All Cities, NYC, San Francisco, Rome Paris
Code Example:
Enum:
public enum City {
ALL, NYC, SANFRANCISCO,...;
}
JSF Page code snippet:
<h:selectOneMenu id="citiesmenu" value="#{enumBeanStatus.selectedCity}">
<f:selectItems value="#{enumBean.cities}"/>
</h:selectOneMenu>