Why selectOneMenu Send ItemLabel to the converter?

前端 未结 4 2174
孤独总比滥情好
孤独总比滥情好 2020-12-01 17:20

my JSF page



                      
     

        
4条回答
  •  被撕碎了的回忆
    2020-12-01 17:33

    You have to use selectitem list in the f:selecitems attribute of h:selectOneMenu

    Your page will be like this;

       
      
              
              
            
      
    
    

    At the backing bean side you have to fill the studentSelectItemList selectitem.

    private List studentSelectItemList;
    
    //fill studentSelectItemList at the appropriate place
      studentSelectItemList.add(new SelectItem(studentId,studentName));
    

    After these settings you should have student id as select value.

提交回复
热议问题