开发者

problem with f:selectItems

开发者 https://www.devze.com 2023-03-07 19:15 出处:网络
I have used the following code to populate the selectbox. The code is <h:form id=\"myForm\" prependId=\"false\">

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消