I am implementing a composite component, and I found a problem that did not find a solution.
I specified my attributes, which may or may not be passed by the page author, but I cannot specify a method attribute (method expression for Action), which, if it was not passed, the composite component does not use the method attribute in the composite tag: tag.
Here is 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 this parameter, I did not specify the actionMethod attribute. Like this:
<util:foo namePrompt="SomeName" showComponent="true"/>
But I get an error message:
javax.faces.FacesException: Unable to resolve composite component from using page using EL expression '#{cc.attrs.actionMethod}'
Is there any way to do this?
source share