我收到错误:从XHTML文件javax.faces.FacesException:价值必须是一个数组或一个集合
javax.faces.FacesException: Value of 'frmrapport:type' must be an array or a collection
:
<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);
}
问题是豆是List
,我无法将列表转换为String[]
。
如果问题是“如何将列表转换为字符串[]”,则它是重复的**和**,非常容易在Internet和SO上查找。但我相信这不是你真正的问题。 –
Nathan