You can't pass method expressions via <ui:param>
. They're interpreted as value expression.
You've basically 3 options:
Split the bean instance and the method name over 2 parameters:
<ui:param name="bean" value="#{managedBean}" /> <ui:param name="method" value="someAction" />
And couple them in the tag file using brace notation
[]
as follows:<p:commandButton action="#{bean[method]}" value="Submit" />
Create a tag handler which converts a value expression to a method expression. The JSF utility library OmniFaces has a
<o:methodParam>
which does that. Use it as follows in the tag file:<o:methodParam name="action" value="#{method}" /> <p:commandButton action="#{action}" value="Submit" />
Use a composite component instead. You can use
<cc:attribute method-signature>
to define action methods as attributes.<cc:interface> <cc:attribute name="method" method-signature="void method()"/> </cc:interface> <cc:implementation> <p:commandButton action="#{cc.attrs.method}" value="Submit"/> </cc:implementation>
Which is used as follows:
<my:button method="#{managedBean.someAction}" />