| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ClientBehavior
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(javax.faces.component.behavior.ClientBehaviorContext) 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
 ResourceDependency or ResourceDependencies annotation. 
| Method Summary | |
|---|---|
|  void | decode(FacesContext context,
       UIComponent component)Decode any new state of this 
  | 
|  java.util.Set<ClientBehaviorHint> | getHints()Returns hints that describe the behavior of the ClientBehavior implementation. | 
|  java.lang.String | getScript(ClientBehaviorContext behaviorContext)Return the script that implements this ClientBehavior's client-side logic. | 
| Methods inherited from interface javax.faces.component.behavior.Behavior | 
|---|
| broadcast | 
| Method Detail | 
|---|
java.lang.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.
behaviorContext - 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().  ClientBehavior
 implementations must not hold onto references to ClientBehaviorContexts.
java.lang.NullPointerException - if behaviorContext is 
 null
void decode(FacesContext context,
            UIComponent component)
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(). Default implementation delegates decoding 
 to ClientBehaviorRenderer.decode(FacesContext, UIComponent, ClientBehavior)
context - FacesContext for the request we are processingcomponent - UIComponent the component associated with this Behavior
java.lang.NullPointerException - if context or 
 component is null.- Since:
- 2.0
java.util.Set<ClientBehaviorHint> getHints()
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
 ClientBehaviorHint.SUBMITTING is present, the
 Renderer may choose to alternate the scripts that it generates
 itself.
| 
 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41