私のJSFページなぜselectOneMenu ItemLabelをコンバーターに送りますか?このコンバータの
<h:form>
<h:selectOneMenu id="studlist" value="#{studBean.selectedStudent}">
<p:ajax event="change" process="studlist" update="studdep" ></p:ajax>
<f:selectItems value="#{studBean.student}" var="s"
itemValue="#{s.studid}" itemLabel="#{s.name}"/>
<f:converter converterId="studentconverter"/>
</h:selectOneMenu>
</h:form>
コンバータクラス(StudentConverter)
public Object getAsObject(FacesContext context, UIComponent component, String value) {
Student studConvert= new Student();
List<Student> students=new ArrayList<Student>();
students=(ArrayList<Student>)((UISelectItems
component.getChildren().get(0)).getValue();
}
それがなぜ起こるか引数 '文字列値は' ITEMLABEL iを与えます? 私はあなたのページは次のようになりますh:selectOneMenu
のf:selecitems
属性でのSelectItemリストを使用する必要があり、この文字列
いつものように素晴らしいBalusC!ありがとう – Mariah