I am using a primefaces selectonemenu, which initially should be empty. I know that i can accomplish that with a <f:selectItem ../>
above of my <f:selectItems ../>
.
However, by doing this, I get this preselected empty <f:selectItem ../>
as seperate item in my dropdown-itemList. It's not relevant whether it's unselectable, blank or anything alike. It shouldn't be there at all.
In other words, the selection should be empty in the beginning, but no empty selectItem should be in the selectItemList.
The only workaround for this I've found so far is the one described in this post: How to show null value in p:SelectOneMenu ONLY when said value is null in the backing bean?.
Having a second selectonemenu in which the initial <f:selectItem ../>
is missing and switching to it as soon as the first one got clicked still doesn't feel like the right approach to me. Is there any better solution for this?
I am running JSF 2.2.12 and PF 6.1.