【问题标题】:javax.el.PropertyNotWritableException Illegal Syntax for Set Operationjavax.el.PropertyNotWritableException 集合操作的非法语法
【发布时间】:2017-06-16 00:07:33
【问题描述】:

我的错误:

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;
} 

我无法提交表单

【问题讨论】:

标签: jsf


【解决方案1】:

value 属性不应该有 getter 方法作为值,因为它也将用于设置选定的值。使用 value="#{userRepoeting.selectedOptions}" 之类的列表并为支持 bean 中的 selectedOptions 定义 getter 和 setter。

【讨论】:

    猜你喜欢
    • 2013-01-10
    • 2013-08-20
    • 1970-01-01
    • 2011-06-04
    • 2017-07-02
    • 2012-03-18
    • 2017-02-21
    • 2014-08-13
    相关资源
    最近更新 更多