Hi<br><br><div class="gmail_quote">2010/10/26 Martin Marinschek <span dir="ltr">&lt;<a href="mailto:mmarinschek@apache.org">mmarinschek@apache.org</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;">
<div class="im">
&gt; G&gt; Martin, I like your proposal on deprecating &quot;targets&quot;. But how would<br>
&gt; G&gt; you then handle this case: Using a cc I nest &lt;f:actionListener<br>
&gt; G&gt; &quot;for=a&quot; ... /&gt; and inside the cc there is a &lt;cc:actionSource name=&quot;a&quot;<br>
&gt; G&gt; targets=&quot;b, c&quot; /&gt; where b and c are buttons? The logic of the &quot;for&quot;<br>
&gt; G&gt; attributes only includes this: &quot;If present, this attribute refers to<br>
&gt; G&gt; the value of *one* of the exposed attached objects within the<br>
&gt; G&gt; composite component inside of which this tag is nested.&quot; IMO<br>
&gt; G&gt; deprecating &quot;targets&quot; would require opening &quot;for&quot; to refer to<br>
&gt; G&gt; *multiple* exposed attached objects within the composite component<br>
&gt; G&gt; inside of which this tag is nested just the way targets is doing this<br>
&gt; G&gt; right now. &quot;targets&quot; kind of bundles them right now.<br>
&gt;<br>
&gt; Yes, exactly.  There was a lot of back and forth between David Geary,<br>
&gt; Ken Paulsen, Kito Mann, Andy Schwartz, and myself on this.<br>
<br>
</div><br>I don&#39;t understand why this is necessary. Multiple component within<br>
the composite could always use the same expression that is available<br>
in cc.attrs?<br>
<div class="im"><br></div></blockquote><div><br>In theory, it is possible (and very easy) to put the method expression on <br>the composite component attribute map for action, actionListener, <br>validator, valueChangeListener and methodExpression attributes. But <br>
things are different for other cases where &quot;targets&quot; attribute is used <br>(cc:actionSource, cc:valueHolder,  cc:editableValueHolder, <br>cc:clientBehavior), because &quot;for&quot; attribute is used to find the cc:attribute <br>
declaration and then use &quot;targets&quot; attribute to attach correctly the objects.<br><br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div class="im">
&gt; G&gt; To make this more convenient omitting &quot;for&quot; could simply be a synonym<br>
&gt; G&gt; representing a &quot;for&quot; for *all* nested actionSources, actionSource2s<br>
&gt; G&gt; and CCs.<br>
&gt;<br>
&gt; I prefer to be explicit here.<br>
<br>
</div>+1!<br>
<div><div></div><div class="h5"><br>
&gt; G&gt; Please follow Jakob&#39;s proposal on adding action, actionListener,<br>
&gt; G&gt; valueChangeListener and validator the attributes map<br>
&gt; G&gt; (#{cc.attrs.action}, #{cc.attrs.actionListener},<br>
&gt; G&gt; #{cc.attrs.valueChangeListener}, #{cc.attrs.validator}). This is what<br>
&gt; G&gt; a developer would expect to happen (at least I did so) and one could<br>
&gt; G&gt; easily pass them on to nested components.<br>
&gt;<br>
&gt; JK&gt; I think we should do this a little differently:<br>
&gt;<br>
&gt; JK&gt; 1) try to add the e.g. ActionListener to the component specified in<br>
&gt; JK&gt; the targets attribute, if possible. If it is not possible, log a<br>
&gt; JK&gt; warning.<br>
&gt;<br>
&gt; JK&gt; 2) also expose the &quot;well-known&quot; attributes (&quot;action&quot;,<br>
&gt; JK&gt; &quot;actionListener&quot;, ...) on the composite component attribute map, this<br>
&gt; JK&gt; means being able to access the action attribute via #{cc.attrs.action}<br>
&gt; JK&gt; (currently not possible, because those attributes are not put on the<br>
&gt; JK&gt; attribute map).<br>
&gt;<br>
&gt; JK&gt; Thus the user can use the targets attribute if he/she wants to (and of<br>
&gt; JK&gt; course, if it is possible) and also use #{cc.attrs.action} to refer to<br>
&gt; JK&gt; the action attribute (like to any other attribute).<br>
&gt;<br>
&gt; JK&gt; Frankly I really don&#39;t understand why this was separated in the first<br>
&gt; JK&gt; place. Of course, the targets attribute is neat, but IMHO it is also<br>
&gt; JK&gt; kinda confusing. I find it a lot easier to access _every_ attribute<br>
&gt; JK&gt; (regardless if well-known or custom) via #{cc.attrs.attributeName}.<br>
&gt; JK&gt; Furthermore using this approach you can support nesting normal<br>
&gt; JK&gt; components and also nesting composite components.<br>
&gt;<br>
&gt; JK&gt; In addition the targets attribute can&#39;t solve a scenario in which the<br>
&gt; JK&gt; action attribute of the inner component is required (most likely the<br>
&gt; JK&gt; attribute from a composite component), because you need to enter a<br>
&gt; JK&gt; value for the attribute, but you currently can&#39;t use<br>
&gt; JK&gt; #{cc.attrs.action}, because this one points &quot;nowhere&quot;.<br>
&gt;<br>
&gt; I&#39;d like to see a prototype of this.  Can anyone step up?<br>
<br>
</div></div>@Leonardo: do you have some time to invest in this? Make it so that<br>
the targets attribute works better, but also make it such that the<br>
whole thing can be used without the targets attribute.<br>
<br></blockquote><div><br>Yes, sure!. I&#39;ll create a patch for Mojarra. <br><br>best regards <br></div></div><br>Leonardo Uribe<br>