0
我々はJSF 2.2プロジェクト(コードを明確にするために簡略化されている)、このように使用される複合コンポーネントである:WildflyでF:複合コンポーネントでAJAXリスナーがWildFlyに動作を停止10
<!-- the page with the composite component inside -->
<my:component methodListener="#{myBean.myMethod}" />
<!-- the composite component -->
<cc:interface>
<cc:attribute name="methodListener" required="true" method-signature="void listener(javax.faces.event.AjaxBehaviorEvent)" />
...
<cc:implementation>
<h:commandLink>
<f:ajax listener="#{cc.attrs.methodListener}" />
<f:attribute name="myAttribute" value="myValue" />
</h:commandLink>
// the called method
public void myMethod(AjaxBehaviorEvent event)
{
System.out.println("> " + event);
}
9.0.2では、複合コンポーネント内のcommandLink
をクリックすると、myMethod
が呼び出され、イベントが定義されます(myAttribute
の値を見つけることができます)。
Wildfly 10.1.0では、正確に同じコードでmyMethod
が呼び出されましたが、イベントパラメータは常にnull
です。
ここで何か間違っていますか?
テスト済みの回避策は、methodListener CC属性を次のコードのようなBeanインスタンスに置き換えることです。それでも、これは私たちのプロジェクトに多くの置き換えが必要なので、この解決法を避けたいと思います。
<!-- the workaround composite component -->
<cc:interface>
<cc:attribute name="methodBean" required="true" type="com.example.myBean" />
...
<cc:implementation>
<h:commandLink>
<f:ajax listener="#{cc.attrs.methodBean.myMethod}" />
<f:attribute name="myAttribute" value="myValue" />
</h:commandLink>