我正在开发一个JSF2,Icefaces web应用程序。我有以下的看法:
<h:dataTable value="#{myFormBB.userRolesBean.userRoleList}" var="row">
<h:column>
<ice:selectBooleanCheckbox value="#{row.teamUser}" />当我保存上面的<ice:selectBooleanCheckbox>时,我得到了下面的异常。
Application caught instance of: javax.faces.component.UpdateModelException
["http-bio-8081"-exec-9] ERROR com.abc.mp.em.common.ui.exception.handler.ExceptionHandler - error
javax.faces.component.UpdateModelException: javax.el.PropertyNotFoundException: /sections/response/myForm.xhtml @599,78 value="#{row.teamUser}": Property 'teamUser' not writable on type boolean
at javax.faces.component.UIInput.updateModel(UIInput.java:849)
at javax.faces.component.UIInput.processUpdates(UIInput.java:731)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1109)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1109)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1109)
at javax.faces.component.UIComponentBase.processUpdates(UIComponentBase.java:1109)我已经在支持bean中正确地定义了属性及其getter和设置。
protected boolean teamUser;
public boolean isTeamUser() {
return teamUser;
}
public void setTeamUser(boolean teamUser) {
this.teamUser = teamUser;
}这是如何引起的,我如何解决它?我需要使用转换器吗?
发布于 2013-01-10 03:55:11
value="#{row.teamUser}":属性“”teamUser“”在boolean类型上不可写
这个错误基本上告诉我们,#{row}是一个boolean (或Boolean),而它实际上没有teamUser属性。
这反过来表明#{myFormBB.userRolesBean.userRoleList}实际上返回了一个List<Boolean>,而不是List<SomeBeanWithTeamUserProperty>。验证并修复您的模型。
https://stackoverflow.com/questions/14244615
复制相似问题