I need to invoke a method of backing component(@facescomponent) of composite component. I see others do this in articles but none of them has ever worked for me.
this how I invoke:
<ui:component xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:cc="http://java.sun.com/jsf/composite">
<cc:interface componentType="formField"/>
<cc:implementation>
<h:commandButton value="doIt" action="#{cc.myAction}" ></h:commandButton>
</cc:implementation>
</ui:component>
and this is the backing component.
@FacesComponent("formField")
public class Field extends UICommand implements NamingContainer {
public Field() {
}
@Override
public String getFamily() {
return UINamingContainer.COMPONENT_FAMILY;
}
public String myAction() {
System.out.println("in action");//not printed
return null;
}
}
Shouldn't myAction
method be invoked? What did I do wrong?