I have a login component. Here it is, severly truncated:
<html xmlns="http://www.w3.org/1999/xhtml" ...>
<composite:interface>
<composite:attribute name="validateMethod"
method-signature="void listener(javax.faces.event.ComponentSystemEvent e) throws javax.faces.event.AbortProcessingException"/>
...
<composite:attribute name="loginAction"
method-signature="java.lang.String action()"/>
</composite:interface>
<composite:implementation>
<h:form ...>
<f:event type="postValidate" listener="#{cc.attrs.validateMethod}"/>
...
<h:commandButton ... action="#{cc.attrs.loginAction}"/>
</h:form>
...
</composite:implementation>
</html>
The action method works, but the validate method does not. When I submit the form, I get this mysterious error:
Unable to resolve composite component from using page using EL expression '#{cc.attrs.validateMethod}'
So...
1. The expression #{cc.attrs.validateMethod} is in the defining page, not the using page. The error message is also clearly wrong about being able to evaluate the component, which is evaluated all over the place in the defining page. I assume that the method cannot be evaluated, for some reason.
2. According to the javadocs for f:event, the method signature for validateMethod above should not be "...ComponentSystemEvent e...". Instead, it should be "...ComponentSystemEvent...", but if I do that, I get another mysterious error:
wrong number of arguments
(Note that wrong is not capitalized, and there is no hints as to what the arguments are)
I don't think I'm doing anything wrong here, so I see no reason why mojarra can't invoke my validate method when I submit the form. Also, the error messages need to be rewritten--they are out of step with the usual meaningful errors that we get nowadays from Facelets.
david