我的错误:
javax.el.PropertyNotWritableException: /rapport.xhtml @295,93 value="#
{userReporting.getNameType(userReporting.selected)}": Illegal Syntax
for Set Operation
我的 XHTML :
<p:selectManyMenu id="type" value="#{userReporting.getNameType(userReporting.selected)}">
<f:selectItem itemLabel="do" itemValue="do" />
<f:selectItem itemLabel="ro" itemValue="ro" />
<f:selectItem itemLabel="go" itemValue="go" />
</p:selectManyMenu>
我的豆子 :
public String[] getNameType(int id){
String[] strings = (String[]) this.genTypeFacade.getNameType(id).stream().toArray(String[]::new);
return strings;
}
我无法提交表单
value 属性不应将 getter 方法作为值,因为它也将用于设置所选值。使用类似 value="#{userRepoeting.selectedOptions}" 的列表,并在支持bean中为selectedOptions定义getter和setter。