属性に Bean 名 (Bean インスタンスではない) を期待するカスタム コンポーネントがあるため、ページ間で実際の Bean 名を渡す必要があります。Bean 自体は非カスタム コンポーネントでも使用されるため、本質的に同じ Bean を指定するため、追加の使用ui:param
(ここで説明されている<rich:modalPanel> でのアクションの受け渡しなど) は避けたいと思います。
で提供される Bean 名を使用してコンポーネントのアクションを指定することは可能ui:param
ですか?
基本的に私は次のことを達成しようとしています:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
template="/template.xhtml">
<ui:param name="beanName" value="sessionBean"/>
...
</ui:composition>
そしてtemplate.xhtmlは
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j"
template="/someothertemplate.xhtml">
</ui:define name="somename">
<h:form>
<a4j:commandButton value="test" action="#{beanName.delete}"/>
</h:form>
</ui:define>
</ui:composition>
削除メソッドは適切に定義されていますが (で検証されていますaction="#{sessionBean.delete}"
)、上記のコードは私に与えます
javax.faces.FacesException: #{beanName.delete}: javax.el.MethodNotFoundException: /template.xhtml @201,89 action="#{beanName.delete}": メソッドが見つかりません: sessionBean.delete()