2

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?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Superman9999
  • 815
  • 3
  • 16
  • 30

1 Answers1

2

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.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555