我收到错误消息:
javax.faces.FacesException:'frmrapport:type' 的值必须是数组或集合
来自 XHTML 文件:
<p:selectManyMenu id="type" required="true"
value="#{userReporting.getTypeParId(userReporting.selected)[0].nomType}">
<f:selectItem itemLabel="co" itemValue="co" />
<f:selectItem itemLabel="pi" itemValue="pi" />
<f:selectItem itemLabel="si" itemValue="si" />
</p:selectManyMenu>
来自 Java bean:
public List getTypeParId(int id){
return this.genTypeFacade.getTypeParId(id);
}
问题是 bean 是 a List
,我无法将列表转换为 a String[]
。