I'm implementing a composite component and I found a issue which I didn't find a solution.
I specified its attributes that can or not be passed by the page author, but I couldn't specify a method attribute (a method expression to Action) that, if it wasn't passed, the composite component doesn't use the method attribute in the composite:implementation tag.
Here my code:
<composite:interface>
<composite:attribute name="namePrompt" required="true"/>
<composite:attribute name="actionMethod" method-signature="java.lang.String action()" required="false"/>
<composite:attribute name="showComponent" default="false"/>
</composite:interface>
<composite:implementation>
<div>
<p:commandLink actionListener="#{cc.attrs.actionMethod}"
rendered="#{cc.attrs.showComponent}"
>
<h:outputText value="#{cc.attrs.namePrompt}"/>
</p:commandLink>
</div>
</composite:implementation>
When using it, I didn't specify the "actionMethod" attribute. Like this:
<util:foo namePrompt="SomeName" showComponent="true"/>
But I get the error message:
javax.faces.FacesException: Unable to resolve composite component from using page using EL expression '#{cc.attrs.actionMethod}'
Is there a way to do this?
actionListener
. What is you use case, what do you think it should happen whenactionListener
is not resolved andcommandLink
is rendered? – Hulse