2010/10/29 Jakob Korherr <jakob.korherr(a)gmail.com>
Hi guys,
Thanks, Andy! Frankly I also do not really like the term "insert"
here, because - as you said - it just does not fit that well. However
I really, really like "implements" - this is just soo much better :)
<h:commandButton ....>
<cc:implementsActionSource name="myActionSource" />
</h:commandButton>
Really beautiful!
It seems that I am perhaps the only dissenting voice here, but I don't care
for this solution.
To those of us that understand the rationale for removing targets and adding
these cc:implements... tags, the new tags make perfect sense. But to the
uninitiated, they will be bewildering. What does it mean for a button to
"implements action source"? Buttons already implement action source. IMO,
targets are much easier to understand, and to explain.
I understand the urge to remove the targets attribute based on their OO
impurity, but I think the solution could use some more thought. There are
already too many arcane oddities in JSF, whose rationale is only intuited by
high priests, and I hate to see us adding more.
david
@Leonardo: I will open an issue for this on MyFaces tomorrow and
provide some patches for it asap!
Regards,
Jakob
2010/10/29 Andy Schwartz <andy.schwartz(a)oracle.com>:
> Hey Jakob -
>
> On 10/29/10 7:02 AM, Jakob Korherr wrote:
>>
>> Hi,
>>
>> Thinking more of it and trying out some prototypes, I now think
>> Leonardo's approach is the way to go. Of course, it would somehow be
>> possible to circumvent the problems mentioned before (like multiple
>> action listeners or the missing f: tag for client behaviors), but
>> after reading the vdldocs again, I think it's much more consistent
>> with what we have right now.
>>
>> Consider the current facet solution: The user can provide facets for
>> the composite component and the author of the composite component can
>> add them to implementation-components via cc:insertFacet.
>
> Agreed. I like the consistency in this approach.
>
> BTW, and slightly off-topic: composite:insertFacet's "name" attribute
> suffers from the same problem as composite:attribute's "name"
attribute:
it
> is also used to refer to both the interface name as well as the
> implementation name. See:
>
>
https://javaserverfaces-spec-public.dev.java.net/issues/show_bug.cgi?id=631
>
> Interestingly, the recommended solution for this is to also add a
> "targetName" attribute. :-)
>
> (This is a slightly different case, since composite:insertFacet lives in
the
> implementation section.)
>
>> And this is
>> exactly what we need for cc:actionSource, cc:valueHolder,
>> cc:editableValueHolder and cc:clientBehavior.
>>
>> Thus I would propose the following new tags (from Leonardo's original
>> proposal):
>>
>> <cc:insertActionSource name="XXX" />
>> <cc:insertEditableValueHolder name="XXX"/>
>> <cc:insertValueHolder name="XXX" />
>> <cc:insertClientBehavior name="XXX" />
>>
>> What do you think?
>>
>
> I like it. :-) Though I wonder whether "insert" is the right verb to
> describe what this tag is doing. In the <cc:insertFacet> case, we
literally
> are inserting a facet component into the component tree. In the
> <cc:insertActionSource> case - we aren't really inserting an action
source.
> The action source is already present: it is the parent of the
> <cc:insertActionSource> tag. It seems like the purpose of the
> <cc:insertActionSource> tag is to identify that the parent action source
> component provides the implementation of the action source that is
> identified in the interface section. Perhaps the verb "implements"
captures
> this better than "insert"?
>
>
> <composite:interface>
> <composite:actionSource name="loginButton"/>
> </composite:interface>
>
> <composite:implementation>
> <h:commandButton>
> <composite:implementsActionSource name="loginButton"/>
> </h:commandButton>
> </composite:implementation>
>
> In any case, regardless of the tag name, I think that this is a much
> improved approach. Thanks for pushing this Jakob (and Leonardo, Martin
and
> Ganesh too)!
>
> Andy
>
>> Regards,
>> Jakob
>>
>>
>
>
--
Jakob Korherr
blog:
http://www.jakobk.com
twitter:
http://twitter.com/jakobkorherr
work:
http://www.irian.at