Hi<br><br>To be more explicit, this is the example that should fail:<br><br>&lt;ez:loginPanel id=&quot;loginPanel&quot; model=&quot;#{bean}&quot;&gt;<br>
        &lt;f:actionListener for=&quot;loginEvent&quot;<br>
                          binding=&quot;#{bean.loginEventListener}&quot; 
/&gt;<br><div id=":4r">
 
        &lt;f:actionListener for=&quot;loginEvent&quot;<br>

                          binding=&quot;#{bean.loginEventListener2}&quot; 
/&gt;<br>
       &lt;f:actionListener for=&quot;cancelEvent&quot;<br>
                          binding=&quot;#{bean.cancelEventListener}&quot; 
/&gt;<br>
      &lt;/ez:loginPanel&gt;<br>
<br>
      &lt;composite:interface name=&quot;loginPanel&quot;&gt;<br>
        &lt;composite:actionSource name=&quot;loginEvent&quot; /&gt;<br>
        &lt;composite:actionSource name=&quot;cancelEvent&quot; /&gt;<br>
      &lt;/composite:interface&gt;<br>
      &lt;composite:implementation&gt;<br>
                  &lt;h:commandButton name=&quot;button1&quot;&gt;<br>
                         &lt;f:actionListener<br>
binding=&quot;#{cc.actionSource.loginEvent}&quot;/&gt;<br>
                  &lt;/h:commandButton&gt;<br>
                  &lt;x:mycompositecomponent name=&quot;button2&quot;&gt;<br>
                         &lt;f:actionListener<br>
binding=&quot;#{cc.actionSource.cancelEvent}&quot; for=&quot;someOtherEvent&quot;/&gt;<br>
                  &lt;/x:mycompositecomponent&gt;<br>
      &lt;/composite:implementation&gt;<br><br>In this case, the binding #{cc.actionSource.loginEvent} does not point to just<br>one actionListener. <br><br>regards,<br><br>Leonardo<br></div> <br><br><div class="gmail_quote">
2010/10/28 Jakob Korherr <span dir="ltr">&lt;<a href="mailto:jakob.korherr@gmail.com">jakob.korherr@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi,<br>
<br>
In option 2 the f:actionListener is just used as a reference to the<br>
cc:actionSource (just as in option 1 but without introducing a new<br>
composite-tag).<br>
<br>
Thus it would actually be possible to have multiple ones!<br>
<br>
Regards,<br>
Jakob<br>
<br>
2010/10/28 Leonardo Uribe &lt;<a href="mailto:lu4242@gmail.com">lu4242@gmail.com</a>&gt;:<br>
<div><div></div><div class="h5">&gt; Hi<br>
&gt;<br>
&gt; 2010/10/28 Jakob Korherr &lt;<a href="mailto:jakob.korherr@gmail.com">jakob.korherr@gmail.com</a>&gt;<br>
&gt;&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; Currently there are a lot of discussions (on spec-issues, on this list<br>
&gt;&gt; and also internally) about the problems with the targets attribute in<br>
&gt;&gt; the composite component interface and I&#39;d like to wrap these up here.<br>
&gt;&gt;<br>
&gt;&gt; IMHO the targets attribute is something we should get rid of, because<br>
&gt;&gt; it directly points to the implementation section and frankly somehow<br>
&gt;&gt; feels like the following piece of code:<br>
&gt;&gt;<br>
&gt;&gt; if (this instanceof Foo)<br>
&gt;&gt; {<br>
&gt;&gt;    // do something<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; The interface section should just specify the interface for the<br>
&gt;&gt; composite component and should not include any information about the<br>
&gt;&gt; implementation section. However, the implementation section should of<br>
&gt;&gt; course refer to the interface section. Unfortunately the targets<br>
&gt;&gt; attribute works against this. And furthermore the targets attribute<br>
&gt;&gt; also confuses users, because the don&#39;t really know which clientid to<br>
&gt;&gt; use (especially with nested components in the implementation section).<br>
&gt;&gt;<br>
&gt;&gt; The first step needed here is to put all attributes (also the<br>
&gt;&gt; &quot;well-known&quot; ones like action, actionListener, valueChangeListener) on<br>
&gt;&gt; the composite component attribute map in order to access them via<br>
&gt;&gt; #{cc.attrs.attributeName}. In this way the user can refer from the<br>
&gt;&gt; implementation section to the related attribute in the interface<br>
&gt;&gt; section, regardless of what it does. This was already discussed and is<br>
&gt;&gt; also already accepted, I guess.<br>
&gt;&gt;<br>
&gt;&gt; The next step is to remove the targets attribute from cc:actionSource,<br>
&gt;&gt; cc:editableValueHolder and cc:valueHolder. Here we have two options:<br>
&gt;&gt;<br>
&gt;&gt; 1) add new composite tags that insert the related listeners in the<br>
&gt;&gt; implementation section (proposed by Leonardo):<br>
&gt;&gt;<br>
&gt;&gt;     &lt;ez:loginPanel id=&quot;loginPanel&quot; model=&quot;#{bean}&quot;&gt;<br>
&gt;&gt;        &lt;f:actionListener for=&quot;loginEvent&quot;<br>
&gt;&gt;                          binding=&quot;#{bean.loginEventListener}&quot; /&gt;<br>
&gt;&gt;        &lt;f:actionListener for=&quot;cancelEvent&quot;<br>
&gt;&gt;                          binding=&quot;#{bean.cancelEventListener}&quot; /&gt;<br>
&gt;&gt;      &lt;/ez:loginPanel&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;composite:interface name=&quot;loginPanel&quot;&gt;<br>
&gt;&gt;        &lt;composite:actionSource name=&quot;loginEvent&quot; /&gt;<br>
&gt;&gt;        &lt;composite:actionSource name=&quot;cancelEvent&quot; /&gt;<br>
&gt;&gt;      &lt;/composite:interface&gt;<br>
&gt;&gt;      &lt;composite:implementation&gt;<br>
&gt;&gt;                  &lt;h:commandButton name=&quot;button1&quot;&gt;<br>
&gt;&gt;                         &lt;composite:insertActionSource name=&quot;loginEvent&quot;/&gt;<br>
&gt;&gt;                  &lt;/h:commandButton&gt;<br>
&gt;&gt;                  &lt;x:mycompositecomponent name=&quot;button2&quot;&gt;<br>
&gt;&gt;                         &lt;composite:insertActionSource<br>
&gt;&gt; name=&quot;cancelEvent&quot; for=&quot;someOtherEvent&quot;/&gt;<br>
&gt;&gt;                  &lt;/x:mycompositecomponent&gt;<br>
&gt;&gt;      &lt;/composite:implementation&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; 2) use the existing tags like f:actionListener and<br>
&gt;&gt; f:valueChangeListener and provide the actionSource,.. via<br>
&gt;&gt; ValueExpression:<br>
&gt;&gt;<br>
&gt;&gt; &lt;ez:loginPanel id=&quot;loginPanel&quot; model=&quot;#{bean}&quot;&gt;<br>
&gt;&gt;        &lt;f:actionListener for=&quot;loginEvent&quot;<br>
&gt;&gt;                          binding=&quot;#{bean.loginEventListener}&quot; /&gt;<br>
&gt;&gt;        &lt;f:actionListener for=&quot;cancelEvent&quot;<br>
&gt;&gt;                          binding=&quot;#{bean.cancelEventListener}&quot; /&gt;<br>
&gt;&gt;      &lt;/ez:loginPanel&gt;<br>
&gt;&gt;<br>
&gt;&gt;      &lt;composite:interface name=&quot;loginPanel&quot;&gt;<br>
&gt;&gt;        &lt;composite:actionSource name=&quot;loginEvent&quot; /&gt;<br>
&gt;&gt;        &lt;composite:actionSource name=&quot;cancelEvent&quot; /&gt;<br>
&gt;&gt;      &lt;/composite:interface&gt;<br>
&gt;&gt;      &lt;composite:implementation&gt;<br>
&gt;&gt;                  &lt;h:commandButton name=&quot;button1&quot;&gt;<br>
&gt;&gt;                         &lt;f:actionListener<br>
&gt;&gt; binding=&quot;#{cc.actionSource.loginEvent}&quot;/&gt;<br>
&gt;&gt;                  &lt;/h:commandButton&gt;<br>
&gt;&gt;                  &lt;x:mycompositecomponent name=&quot;button2&quot;&gt;<br>
&gt;&gt;                         &lt;f:actionListener<br>
&gt;&gt; binding=&quot;#{cc.actionSource.cancelEvent}&quot; for=&quot;someOtherEvent&quot;/&gt;<br>
&gt;&gt;                  &lt;/x:mycompositecomponent&gt;<br>
&gt;&gt;      &lt;/composite:implementation&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; Frankly I&#39;d prefer option 2, because it is very similar to how we<br>
&gt;&gt; handle cc:attribute --&gt; #{cc.attrs.xxx}.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; One remaining problem here, however, is how to handle non-required<br>
&gt;&gt; method-attributes (there&#39;s a thread about this on the<br>
&gt;&gt; myfaces-user-list). IMO the default attribute of cc:attribute should<br>
&gt;&gt; be able to resolve to a MethodExpression and not only to a String (I<br>
&gt;&gt; think this is already a spec-issue), but it should also work without<br>
&gt;&gt; providing a default value. In that case #{cc.attrs.thatAttribute}<br>
&gt;&gt; should internally return an empty action/listener/... so that there<br>
&gt;&gt; are no problems with the related implementation-components which refer<br>
&gt;&gt; to this attribute.<br>
&gt;&gt;<br>
&gt;&gt; What do you think?<br>
&gt;&gt;<br>
&gt;<br>
&gt; Well, unfortunately use option 2 forces to use just one f:actionListener per<br>
&gt; actionSource, and in theory, it should be possible to have multiple ones.<br>
&gt;<br>
&gt; best regards,<br>
&gt;<br>
&gt; Leonardo Uribe<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Jakob<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Jakob Korherr<br>
&gt;&gt;<br>
&gt;&gt; blog: <a href="http://www.jakobk.com" target="_blank">http://www.jakobk.com</a><br>
&gt;&gt; twitter: <a href="http://twitter.com/jakobkorherr" target="_blank">http://twitter.com/jakobkorherr</a><br>
&gt;&gt; work: <a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
&gt;<br>
&gt;<br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div class="h5">Jakob Korherr<br>
<br>
blog: <a href="http://www.jakobk.com" target="_blank">http://www.jakobk.com</a><br>
twitter: <a href="http://twitter.com/jakobkorherr" target="_blank">http://twitter.com/jakobkorherr</a><br>
work: <a href="http://www.irian.at" target="_blank">http://www.irian.at</a><br>
</div></div></blockquote></div><br>