-
- All Superinterfaces:
- Behavior
- All Known Implementing Classes:
- AjaxBehavior, ClientBehaviorBase
public interface ClientBehavior extends Behavior
ClientBehavior is the base contract for
Behavior
s that attach script content to client-side events exposed byClientBehaviorHolder
components. Instances ofClientBehavior
may be attached to components that implement theClientBehaviorHolder
contract by callingClientBehaviorHolder.addClientBehavior(java.lang.String, javax.faces.component.behavior.ClientBehavior)
. Once aClientBehavior
has been attached to aClientBehaviorHolder
component, the component callsgetScript(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 theResourceDependency
orResourceDependencies
annotation.- Since:
- 2.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description void
decode(FacesContext context, UIComponent component)
Decode any new state of this
ClientBehavior
from the request contained in the specifiedFacesContext
.Set<ClientBehaviorHint>
getHints()
Returns hints that describe the behavior of the ClientBehavior implementation.
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
-
getScript
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.
- Parameters:
behaviorContext
- theClientBehaviorContext
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.- Returns:
- script that provides the client-side behavior, or null if no script is required.
- Throws:
NullPointerException
- ifbehaviorContext
isnull
- Since:
- 2.0
-
decode
void decode(FacesContext context, UIComponent component)
Decode any new state of this
ClientBehavior
from the request contained in the specifiedFacesContext
.During decoding, events may be enqueued for later processing (by event listeners who have registered an interest), by calling
queueEvent()
. Default implementation delegates decoding toClientBehaviorRenderer.decode(FacesContext, UIComponent, ClientBehavior)
- Parameters:
context
-FacesContext
for the request we are processingcomponent
-UIComponent
the component associated with thisBehavior
- Throws:
NullPointerException
- ifcontext
orcomponent
is
null
.- Since:
- 2.0
-
getHints
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.- Returns:
- a non-null, unmodifiable collection of ClientBehaviorHints.
- Since:
- 2.0
-
-
Deutsche Übersetzung
Sie haben gebeten, diese Seite auf Deutsch zu besuchen. Momentan ist nur die Oberfläche übersetzt, aber noch nicht der gesamte Inhalt.Wenn Sie mir bei Übersetzungen helfen wollen, ist Ihr Beitrag willkommen. Alles, was Sie tun müssen, ist, sich auf der Website zu registrieren und mir eine Nachricht zu schicken, in der Sie gebeten werden, Sie der Gruppe der Übersetzer hinzuzufügen, die Ihnen die Möglichkeit gibt, die gewünschten Seiten zu übersetzen. Ein Link am Ende jeder übersetzten Seite zeigt an, dass Sie der Übersetzer sind und einen Link zu Ihrem Profil haben.
Vielen Dank im Voraus.
Dokument erstellt 11/06/2005, zuletzt geändert 18/08/2025
Quelle des gedruckten Dokuments:https://www.gaudry.be/de/java-api-javaee-rf-javax/faces/component/behavior/ClientBehavior.html
Die Infobro ist eine persönliche Seite, deren Inhalt in meiner alleinigen Verantwortung liegt. Der Text ist unter der CreativeCommons-Lizenz (BY-NC-SA) verfügbar. Weitere Informationen auf die Nutzungsbedingungen und dem Autor.
Referenzen
Diese Verweise und Links verweisen auf Dokumente, die während des Schreibens dieser Seite konsultiert wurden, oder die zusätzliche Informationen liefern können, aber die Autoren dieser Quellen können nicht für den Inhalt dieser Seite verantwortlich gemacht werden.
Der Autor dieser Website ist allein dafür verantwortlich, wie die verschiedenen Konzepte und Freiheiten, die mit den Nachschlagewerken gemacht werden, hier dargestellt werden. Denken Sie daran, dass Sie mehrere Quellinformationen austauschen müssen, um das Risiko von Fehlern zu reduzieren.