I have a JSF composite component util_primefaces:inplace_name that requires a "manager" backing bean that performs persistence updates when the 'name' field of an entity is edited (using p:inplace):
<cc:interface>
<cc:attribute name="manager" type="com.example.web.AbstractManager" required="false" default="#{blockManager}"/>
<cc:attribute name="element" type="com.example.entity.Element" required="true"/>
<cc:attribute name="elid" required="true"/>
<cc:attribute name="update" required="false" default="@parent"/>
..
</cc:interface>
<cc:implementation>
..
<p:inplace id="#{cc.attrs.elid}" editor="true" emptyLabel="UNDEF" >
<p:ajax
event="save"
listener="#{cc.attrs.manager.onInplaceNameSaveEvent}"
process="@this #{cc.attrs.elid}-name"
update="#{cc.attrs.update}"
/>
<h:inputText id="#{cc.attrs.elid}-name" value="#{cc.attrs.element.name}"/>
..
Where for example @ViewScoped @ManagedBean BlockManager ultimately extends an AbstractManager, which has a listener method:
public void onInplaceNameSaveEvent(AjaxBehaviorEvent ae).
[ASIDE: the reason for the unusual "elid" attribute is described here, it plays no further role in this question: Primefaces p:inplace: How to more elegantly propagate the EL expression for entity to merge ]
When I invoke the composite component passing in an explicit #{blockManager} (or other subclass of AbstractManager) it works fine:
<util_primefaces:inplace_name
element="#{tenancy}"
elid="tenancy"
manager="#{blockManager}"
/>
But if I don't pass in the #{blockManager}, on performing the inplace edit and save I get an error that the method onInplaceNameSaveEvent(AjaxBehaviorEvent) is not known:
<util_primefaces:inplace_name
element="#{tenancy}"
elid="tenancy"
/>
The error is:
WARNING: Method not found: [email protected](javax.faces.event.AjaxBehaviorEvent)
javax.el.MethodNotFoundException: Method not found: [email protected](javax.faces.event.AjaxBehaviorEvent)
at com.sun.el.util.ReflectionUtil.getMethod(ReflectionUtil.java:155)
Q: Why is the backing bean not taken correctly using default="#{blockManager}" in the composite component attribute ?