Ed -
@ResourceDependency annotates a component class to denote that the class
has a dependency on a particular resource (eg. a JavaScript library, or
style sheet).
Client behaviors allow executable scripts (ie. event handlers) to be
attached to individual components at event points defined by the
component class.
So this pulls in the "foo.js" JavaScript library any time a Foo
component is present in the component tree:
@ResourceDependency(name="foo.js")
public class FooComponent extends UIComponentBase { ...}
And this attaches an Ajax behavior to the "mouseover" event on a
FooComponent instance, causing an Ajax request to be fired when the user
mouses over the component's content:
<my:foo id="bar">
<f:ajax event="mouseover"/>
</my:foo>
Roger -
Let's sync up tomorrow and see if we can make sure that the spec is
clear on this.
Andy
Ed Burns wrote On 3/14/2009 9:49 PM ET:
Roger just added section 2.5.9 to the spec, to provide a high level
overview of the
Component Behavior feature. In this section, Roger says:
"Component behavors provide a mechanism for enhancing existing components with
functionality that is not an inherant part of the component itself. The first type of
component behavior that is introduced is client behavior. Client behaviors provide the
ability to attach client side scripts to components."
As Roger has been driving component behaviors, I have not been paying close attention
to the feature. Therefore, I read Roger's overview section with great interest.
When I
read the above text, I had to ask: If client behaviors allow attaching a client side
script to
components, how is that different from having an
@ResourceDependency(name="script.js")?
Roger, this basic question needs to be addressed in the overview.
I've uploaded the PDF that contains 2.5.9 and other kinds of Overview sections as
well.
It's at <
https://javaserverfaces-spec-
public.dev.java.net/files/documents/1936/129539/JSF_20090314.pdf>.
ACTION: Andy or Roger, please answer my basic question.
Thanks,
Ed