javax.faces.component.UpdateModelException: javax.el.PropertyNotFoundException:

Superman9999 picture Superman9999 · Jan 9, 2013 · Viewed 7.8k times · Source

I am working on a JSF2, Icefaces web application. I have the following view:

<h:dataTable value="#{myFormBB.userRolesBean.userRoleList}" var="row">
    <h:column>
        <ice:selectBooleanCheckbox value="#{row.teamUser}" />

I get the below exception when I save the above <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)

I have properly defined the property and its getter and setting in the backing bean.

protected boolean teamUser;

public boolean isTeamUser() {
    return teamUser;
}

public void setTeamUser(boolean teamUser) {
    this.teamUser = teamUser;
}

How is this caused and how can I solve it? Do I need to use a converter?

Answer

BalusC picture BalusC · Jan 9, 2013

value="#{row.teamUser}": Property 'teamUser' not writable on type boolean

This error is basically telling that #{row} is a boolean (or Boolean) which in turn indeed doesn't have a teamUser property.

This in turn suggests that #{myFormBB.userRolesBean.userRoleList} actually returned a List<Boolean> instead of List<SomeBeanWithTeamUserProperty>. Verify and fix your model.