I’m trying to update a Prime Faces PickList with a RemoteCommnad and I’m getting a javax.el.PropertyNotFoundException: Property 'updatePermissions' not found exception when the updatePermission property is defined.
This is my UI definition file:
<h:form>
...
<h:selectOneMenu id="groupsList" value="#{permissionsToGroupsBean.selectedGroup}" title="Select Group" onclick="updatePermissions()">
<f:selectItems value="#{permissionsToGroupsBean.allGroups}" />
</h:selectOneMenu>
....
<p:pickList
id="permissions"
value="#{permissionsToGroupsBean.permissionsPickList}"
var="permissionsPickList"
itemLabel="#{permissionsPickList}"
itemValue="#{permissionsPickList}" />
....
</h:panelGrid>
<p:remoteCommand name="updatePermissions" actionListener="#{permissionsToGroupsBean.updatePermissions}" update="permissions"/>
This the controller that is supposed to handle the UI:
public class PermissionsToGroupsBean implements Serializable {
...
public void updatePermissions() {
getPermissionsPickList().setTarget(getPermissionsForSelectedGroup());
}
}
When I access the page URL I get:
javax.el.PropertyNotFoundException: Property 'updatePermissions' not found on type tld.company.admin.web.bean.PermissionsToGroupsBean
javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:193)
javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:170)
javax.el.BeanELResolver.property(BeanELResolver.java:279)
javax.el.BeanELResolver.getValue(BeanELResolver.java:60)
com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
org.apache.el.parser.AstValue.getValue(AstValue.java:118)
org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
com.sun.faces.facelets.el.ELText$ELTextVariable.toString(ELText.java:214)
com.sun.faces.facelets.el.ELText$ELTextComposite.toString(ELText.java:155)
com.sun.faces.facelets.compiler.CommentInstruction.write(CommentInstruction.java:77)
com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
com.sun.faces.facelets.compiler.UILeaf.encodeAll(UILeaf.java:183)
Any help greatly appreciated, thanks.
Found it … the problem was that Prime Faces doesn’t handle comments for some reason …
I had a commented out action listener defined under the one I posted in the question:
As soon as I removed it it worked.
A signature with
voidreturn type and no parameters works: