Here's my selectOneMenu:
<h:form>
<p:selectOneMenu id="handlerSelect" value="#{caseController.case.handler}"
converter="omnifaces.SelectItemsIndexConverter" style="width:182px">
<f:selectItems value="#{handlerController.findAllHandlers()}"
var="handlerSelect" itemLabel="#{handlerSelect.name}"
itemValue="#{handlerSelect}" />
<p:ajax event="change"listener="#{caseController.changeHandler}" update="handlerSelect"/>
</p:selectOneMenu>
</h:form>
The default value showing in this selectOneMenu
as the user opens the view, is the name of the handler person of the case the user opens. Now, some cases have null
as the value in the database. In those cases, the value is the name of the first handler person in the handler list. This is obviously wrong, since the value showing shouldn't be a handler person's name because the case in question doesn't have a handler person, but a null in the handler column of the case row.
Now, how can I show some custom text eg. "Choose handler" WHEN the handler property is null
on the case object?