Top Description Constructors Methods
jakarta.faces.render

public abstract Class ClientBehaviorRenderer

extends Object
Class Inheritance
Imports
jakarta.faces.component.UIComponent, jakarta.faces.component.behavior.ClientBehavior, .ClientBehaviorContext, jakarta.faces.context.FacesContext

A ClientBehaviorRenderer produces the client-side script that implements a ClientBehavior's client-side logic. It can also enqueue server-side jakarta.faces.event.BehaviorEvents that may be processed later by event listeners that have registered an interest.

Individual ClientBehaviorRenderer instances will be instantiated as requested during the rendering process, and will remain in existence for the remainder of the lifetime of a web application. Because each instance may be invoked from more than one request processing thread simultaneously, they MUST be programmed in a thread-safe manner.

Since
2.0

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
decode(FacesContext
FacesContext for the request we are processing
context
,
UIComponent
UIComponent the component associated with this jakarta.faces.component.behavior.Behavior
component
,
ClientBehavior
ClientBehavior the behavior instance
behavior
)

Decode any new state of this ClientBehavior from the request contained in the specified FacesContext.

public String

Returns:

script that provides the client-side behavior, or null if no script is required.
getScript
(ClientBehaviorContext
the 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(). ClientBehaviorRenderer implementations must not hold onto references to ClientBehaviorContexts.
behaviorContext
,
ClientBehavior
the ClientBehavior instance that generates script.
behavior
)

Return the script that implements this ClientBehavior's client-side logic.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClientBehaviorRendererback to summary
public ClientBehaviorRenderer()

Method Detail

decodeback to summary
public void decode(FacesContext context, UIComponent component, ClientBehavior behavior)

Decode any new state of this ClientBehavior from the request contained in the specified FacesContext.

During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by calling queueEvent().

Parameters
context:FacesContext

FacesContext for the request we are processing

component:UIComponent

UIComponent the component associated with this jakarta.faces.component.behavior.Behavior

behavior:ClientBehavior

ClientBehavior the behavior instance

Exceptions
NullPointerException:
if context, component behavior is null
Since
2.0
getScriptback to summary
public String getScript(ClientBehaviorContext behaviorContext, ClientBehavior behavior)

Return the script that implements this ClientBehavior's client-side logic. The default implementation returns null.

ClientBehaviorRenderer.getScript() implementations are allowed to return null to indicate that no script is required for this particular getScript() call. For example, a ClientBehaviorRenderer implementation may return null if the associated ClientBehavior is disabled.

Parameters
behaviorContext:ClientBehaviorContext

the 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(). ClientBehaviorRenderer implementations must not hold onto references to ClientBehaviorContexts.

behavior:ClientBehavior

the ClientBehavior instance that generates script.

Returns:String

script that provides the client-side behavior, or null if no script is required.

Since
2.0