Hi<br><br>Attached to this issue:<br><br><a href="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=755">https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=755</a><br><br> there is a patch that shows what is required to use<br>
<br>#{cc.attrs.action} , <br>#{cc.attrs.actionListener} , <br>#{cc.attrs.validator} , <br>#{cc.attrs.valueChangeListener} <br><br>The idea is just use this expressions instead set "targets" property on cc:attribute.<br>
<br>In this way it is possible to write something like this:<br><br>testActionVE.xhtml<br><br><testcc:actionVE label="Press me" action="#{helloWorld.send2}"/><br><br>actionVE.xhtml<br><br><cc:interface><br>
<cc:attribute name="action"/><br> <cc:attribute name="label"/><br></cc:interface><br><cc:implementation><br> <h:commandButton value="#{cc.attrs.label}" action="#{cc.attrs.action}"/><br>
</cc:implementation><br><br>Fortunately, this change does not prevent "targets" attribute to work. From my point<br>of view seems to be very intuitive, compared with the other style.<br><br><cc:interface><br>
<cc:attribute name="action" targets="button" /><br>
<cc:attribute name="label"/><br>
</cc:interface><br>
<cc:implementation><br>
<h:commandButton id="button" value="#{cc.attrs.label}"/><br>
</cc:implementation><br><br>So at least for cc:attribute it seems valid (and wanted) to do the change.<br><br>Thinking more about this issues I have a proposal to solve:<br><br><a href="https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=859">https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=859</a><br>
<br>Composite components only support one action attribute<br><br>Why this syntax is not possible?<br><br><cc:interface><br>
<cc:attribute name="action" method-signature="Object myMethod();void myMethod()" ..../><br> <cc:attribute name="actionListener" method-signature="void myMethod(javax.faces.event.ActionEvent);void
myMethod()" ..../><br>
<cc:attribute name="label"/><br>
</cc:interface><br><br>That means, allow multiple signatures for a method expression and use some wrapper <br>like the one proposed with the previous patch.<br><br>One last comment: How to deprecate "targets" also for cc:actionSource, cc:valueHolder, <br>
cc:editableValueHolder and cc:clientBehavior? One possibility is do something like this:<br><br> <ez:loginPanel id="loginPanel" model="#{bean}"><br> <f:actionListener for="loginEvent"<br>
binding="#{bean.loginEventListener}" /><br> <f:actionListener for="cancelEvent"<br> binding="#{bean.cancelEventListener}" /><br>
</ez:loginPanel> <br><br> <composite:interface name="loginPanel"><br> <composite:actionSource name="loginEvent" /><br> <composite:actionSource name="cancelEvent" /><br>
</composite:interface> <br> <composite:implementation><br> <h:commandButton name="button1"><br> <composite:insertActionSource name="loginEvent"/><br>
</h:commandButton><br> <x:mycompositecomponent name="button2"><br>
<composite:insertActionSource
name="cancelEvent" for="someOtherEvent"/><br>
</x:mycompositecomponent><br>
</composite:implementation><br><br>In few words, use a tag to insert the attached objects. That will work, because<br>in a composite component first it is resolved the body on the page than the tags<br>inside composite:implementation. The advantage over "targets" stuff is the <br>
implementation details are when the people expect and it could handle complex<br>cases in a better way like nested composite components usage, and override "for"<br>attribute.<br><br>I know implement that proposal could be complex to implement, but I think it <br>
could be good to at least take it into consideration. <br><br>I can provide more code of each proposal if necessary.<br><br>best regards,<br><br>Leonardo Uribe<br>