0

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.

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
TsTiX
  • 375
  • 2
  • 5
  • Does it work with a plain jsf `h:selectonemenu` – Kukeltje Dec 06 '17 at 13:37
  • @Kukeltje Could you explain that a bit more detailed please? I don't know what the ``h:selectonemenu`` should change about the selectItem-problem. – TsTiX Dec 06 '17 at 15:25

0 Answers0