It is already possible to attach behaviors to composite components that are retargeted to via <cc:clientBehavior> but is not possible to attach a behavior directly to a composite component, with no target).
UINamingContainer should implement ClientBehaviorHolder and support decoding of behaviors. It should be possible to configure the supported events using the <cc:clientBehavior> with no "name" attribute or maybe with the special keyword "@this" in the "targets" attribute.
The script of a behavior could be made available in the composite component implementation for example via an EL expression.
<cc:clientBehavior event="focus" />
|Field||Original Value||New Value|
|Status Whiteboard||size_medium importance_medium|
|Assignee||rogerk [ rogerk ]|
|Priority||Major [ 3 ]||Trivial [ 5 ]|
|Priority||Trivial [ 5 ]||Minor [ 4 ]|