ClientBehavior is the base contract for Behaviors that attach script content to client-side
events exposed by ClientBehaviorHolder components. Instances of ClientBehavior may be attached
to components that implement the ClientBehaviorHolder contract by calling
ClientBehaviorHolder#addClientBehavior. Once a ClientBehavior has been attached to a
ClientBehaviorHolder component, the component calls getScript to obtain the behavior's script and
the component wires this up to the appropriate client-side event handler. Note that the script content returned by
this method is always in-line script content. If the implementing class wants to invoke functions defined in other
script resources, the implementing class must use the jakarta. or
jakarta. annotation.
| Modifier and Type | Method and Description |
|---|---|
| public void | decode(FacesContext
FacesContext for the request we are processingUIComponent the component associated with this Behavior
Decode any new state of this |
| public Set | Returns: a non-null, unmodifiable collection of ClientBehaviorHints.Returns hints that describe the behavior of the ClientBehavior implementation. |
| public String | Returns: script that provides the client-side behavior, or null if no script is required.the behaviorContext)ClientBehaviorContext that provides properties that might influence this
getScript() call. Note that ClientBehaviorContext instances are short-lived objects that are only valid for the
duration of the call to getScript(). ClientBehavior implementations must not hold onto references to
ClientBehaviorContexts.Return the script that implements this ClientBehavior's client-side logic. |
| decode | back to summary |
|---|---|
| public void decode(FacesContext context, UIComponent component)
Decode any new state of this
During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by
calling
| |
| getHints | back to summary |
|---|---|
| public Set
Returns hints that describe the behavior of the ClientBehavior implementation. The hints may impact how Renderers
behave in the presence of Behaviors. For example, when a Behavior that specifies
| |
| getScript | back to summary |
|---|---|
| public String getScript(ClientBehaviorContext behaviorContext) Return the script that implements this ClientBehavior's client-side logic. ClientBehavior.getScript() implementations are allowed to return null to indicate that no script is required for this particular getScript() call. For example, a ClientBehavior implementation may return null if the Behavior is disabled.
| |