Hi there,
I have a selectOneMenu like this...
<h:selectOneMenu id="combo" value="${myBackingBean.myString}" >
<f:selectItem itemValue="A" itemLabel="Ok, there's some text... " />
<f:selectItem itemValue="null" itemLabel="Never is Selected" />
</h:selectOneMenu>
Sometimes myBackingBean.myString evaluates to an empty
String, I mean it has a null value.
But when this happens, the correct option, that would be itemValue="null" itemLabel="Never is Selected" isn't selected by default.
In fact, I don't know why, the oder option is selected instead - "Ok, there's some text... "
I've found this on the web ...
discussion, same problem
It's the same case, then I tried these changes...
<f:selectItem itemLabel="Never is selected" />
<f:selectItem itemValue="${null}" itemLabel="Never is selected" />
<f:selectItem itemValue="null" itemLabel="Never is selected" />
Neither of them worked...
Suggestions please? Thanks!