문제

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>
도움이 되었습니까?

해결책

You should use the noSelectionOption attribute

Like this

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

다른 팁

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top