problem with f:selectItems
I have used the following code to populate the selectbox. The code is
<h:form id="myForm" prependId="false">
<h:selectOneMenu id ="user" value="#{customer.userName}" >
<f:selectItem itemLabel="Select One" itemValue="Jose" />
<f:selectItems value="#{customer.perInfoAll}" var="model" itemValue="#{model.userName}" itemLabel="#{model.userName}" />
</h:selectOneMen开发者_Go百科u >
</h:form>
the itemLabel is showing me the correct string value, but the itemValue property for each option is showing me the list I get from the listener. Please correct me.
<f:selectItems> accepts list of SelectItem which contains a value label pair.
Check the usage here.
精彩评论