複合コンポーネントのバッキング コンポーネント(@facescomponent)のメソッドを呼び出す必要があります。記事で他の人がこれを行っているのを見ますが、どれも私のために働いたことはありません.
これは私がどのように呼び出すかです:
<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>
これがバッキング コンポーネントです。
@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;
}
}
myAction
メソッドを呼び出すべきではありませんか? 私は何を間違えましたか?