Question

I have this editable selectOneMenu which correctly resets/repopulates on its previous selectOneMenu change. but it always show blank instead of the first value - 'Please select/Enter statement'

<p:selectOneMenu id="statement" style="width:300px;" value="#{mgBean.statement}" 
editable="true" panelStyle="width:200px;">
>                                   
  <f:selectItem itemLabel="Please select/Enter statement" itemValue="" />
  <f:selectItems  value="#{mgBean.statementList}" var="stmt" itemLabel="#{stmt.defaultStatement}" itemValue="#{stmt.defaultStatementValue}" />
</p:selectOneMenu>
Était-ce utile?

La solution

You should use the noSelectionOption attribute

Like this

<f:selectItem itemLabel="Please select/Enter statement" noSelectionOption="true"/>

Autres conseils

Try setting the attribute label="Please select/Enter statement" for the p:selectOneMenu tag.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top