This is basically an extension to this answer.
I am trying to get an argument into a method/action call (for a delete button in a list/data table).
Client:
<ui:include src="...">
<ui:param name="acceptButtonBean" value="#{repoHome}" />
<ui:param name="acceptButtonAction" value="removeIndividualDocument(#{doc.id})" />
</ui:include>
Sub view:
<h:commandButton value="Continue"
action="#{acceptButtonBean[acceptButtonAction]}" />
...
</h:commandButton>
However, JSF fails with an exception saying:
...yadda, yadda
02:46:02,431 ERROR [stderr] (http--127.0.0.1-8080-5) Caused by: javax.el.MethodNotFoundException: /subviews/remove-doc-clink-popup.xhtml @37,98 action="#{acceptButtonBean[acceptButtonMethod]}": Method not found: com.company.project.beans.RepoHome@34b183e7.removeExternalDocument(89)()
02:46:02,431 ERROR [stderr] (http--127.0.0.1-8080-5) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:109)
02:46:02,431 ERROR [stderr] (http--127.0.0.1-8080-5) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
02:46:02,431 ERROR [stderr] (http--127.0.0.1-8080-5) ... 31 more
Note the
[email protected](89)()
It can't work that way. JSF seems to append parentheses no matters what.
Can it be achieved differently, but still with the above technique? If so, how?
If not, why isn't it working? Is it specified? Is it a bug with Mojarra 2.0.x? I see no problem to omit the parentheses in case of the presence of other parentheses...
Note I'm not looking for alternative solutions like using f:param, f:attribute, or f:setPropertyActionListener.
Thanks in advance
RepoHome#toString()
instead ofRepoHome#getClass()
. – Eld