Behavior
Attaches any of the predefined JSF Widget Library (JWL) actions and/or user-supplied JavaScriptâ„¢ to the DOM event handler of a component. This allows a user to attach a pre-defined block of JavaScript (a JWL Action) to an event handler.
Rendering
This component has no visual rendering. No HTML is rendered.
Quick Edit view
Configure this component using the Quick Edit view. To open the Quick Edit view, click
Window | Show View | Quick Edit.
The common attributes for the <hx:behavior> component are listed in the table below.
Table 1. Behavior attributes Attribute name
Description
behaviorAction
The name of the action(s) to be run. If more than one action name is provided they should be separated with a semicolon.
For information on available actions, refer to Actions.
binding
An expression that binds the component's instance (usually a user interface component) to a bean property (usually in the backing file).
event
The name of the event to which the behavior is attached. For example "onclick". It must include the "on" prefix.
id
Assigns a name to a component. Should be a unique name within a JSP.
onActionFunction
A JavaScript function to be executed. The function is executed before the action is executed. If the function returns false, the action is not run and processing of the event is halted.
rendered
Can be set to true or false:
- false - Component will not be rendered to the browser at runtime.
- true - Component will get rendered. This is the default value.
target
Normally the behavior applies to the parent tag. Target can be used to assign it to a different tag. Note the value may identify an HTML (non-JSF) tag. #body can be supplied to apply the behavior to the entire page.
targetAction
The target(s) of the action(s) to be run. By default, the action's target is the tag the behavior is assigned to (as a child or via target). If more than one action is provided, more than one target may be provided (separated by semicolons).
targetFacet
Normally the behavior applies to the parent tag. targetFacet can be used to assign it to the content of the named facet.