I am trying to populate selectBooleanCheckbox values using ui:repeat as the values are taken from a list. The checkbox values are assigned fine, but the listener is not called when I change the selectBooleanCheckbox value. I also got this error when changing the value
Illegal Syntax for Set Operation: javax.el.PropertyNotWritableException: Illegal Syntax for Set Operation
Here is my code
<ui:repeat value="#{myBean.myObjects}" var="object">
<p:selectBooleanCheckbox
value="#{myBean.isObjectSelected(object)}">
<p:ajax update="growl"
listener="#{myBean.doSomethingtoObject(object)}" />
</p:selectBooleanCheckbox>
<h:outputText value="#{object.name}" />
</ui:repeat>
The issue comes from value="#{myBean.isObjectSelected(object)}"
part. When I removed that part the error is gone and the listener is called fine. But how else would I get the checkbox value without it? Even if I straight away assign the value to be #{true}
the listener would not be called. I found similar issues but not with ajax listeners.
ui:repeat
? With a different component thanselectBooleanCheckbox
and if the error is from#{myBean.isObjectSelected(object)}
it is normal the ajax listener is not called. Your question is not related to any of the tags but to EL. So post the error you get in google and start reading... – Kukeltjeboolean selected
property with corresponding getters and setters. Then change yourui:repeat value="#{myBean.myObjectDecorators}" var="objectDecorator"
and yourp:selectBooleanCheckbox value="#{objectDecorator.selected}"
– Selaron