David -
David Geary wrote On 5/24/2009 5:55 PM ET:
For JSF 2, we added a "for" attribute to f:actionListener,
f:converter, etc., but we don't have a "for" attribute for <f:ajax>.
AFAICT, that means that although you can attach listeners, validators,
converters, etc. to a component contained in a composite component,
you cannot attach Ajax functionality.
Why is that? Is it an oversight, or is there some compelling technical
reason to disallow adding Ajax behavior to components contained in
composites?
We definitely intended to support this, though instead of exposing a
"for" attribute on <f:ajax>, we wanted to leverage the fact that
behaviors already have a targeting mechanism in the "event" name. The
idea was that a composite component would, like any other
ClientBehaviorHolder, expose a set of logical event names that behaviors
can be attached to. So, for example, assuming a composite component
included "OK" and "Cancel" buttons and wanted to allow the user to
attach action behaviors to these, the composite component might surface
"okAction" and "cancelAction" event names, allowing the page author to
do:
<foo:someComposite>
<f:ajax event="okAction"/>
<f:ajax event="cancelAction"/>
</foo:someComposite>
I know that Alexander did the implementation work to get this up and
running. However, I do not see any pdldoc for the composite tag that
the composite component author uses to specify the supported client
behavior event names (composite:clientBehavior I believe).
Alex, Roger -
Did this make it into 2.0?
Andy
Thanks,
david