Klasse EventHandler
java.lang.Object
javax.faces.view.facelets.TagHandler
javax.faces.view.facelets.MetaTagHandler
javax.faces.view.facelets.DelegatingMetaTagHandler
javax.faces.view.facelets.ComponentHandler
org.apache.myfaces.tobago.facelets.TobagoComponentHandler
org.apache.myfaces.tobago.facelets.EventHandler
- Alle implementierten Schnittstellen:
javax.faces.view.AttachedObjectHandler,javax.faces.view.BehaviorHolderAttachedObjectHandler,javax.faces.view.facelets.FaceletHandler
public class EventHandler
extends TobagoComponentHandler
implements javax.faces.view.BehaviorHolderAttachedObjectHandler
This tag creates an instance of AjaxBehavior, and associates it with the nearest
parent UIComponent that implements ClientBehaviorHolder interface. This tag can
be used on single or composite components.
Unless otherwise specified, all attributes accept static values or EL expressions.
According to the documentation, the tag handler implementing this tag should meet the following conditions:
- Since this tag attach objects to UIComponent instances, and those instances implements Behavior interface, this component should implement BehaviorHolderAttachedObjectHandler interface.
- f:ajax does not support binding property. In theory we should do something similar to f:convertDateTime tag does: extends from ConverterHandler and override setAttributes method, but in this case BehaviorTagHandlerDelegate has binding property defined, so if we extend from BehaviorHandler we add binding support to f:ajax.
- This tag works as a attached object handler, but note on the api there is no component to define a target for a behavior. See comment inside apply() method.
- Seit:
- 3.0.0
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic final classWraps a method expression in a AjaxBehaviorListener -
Feldübersicht
FelderVon Klasse geerbte Felder javax.faces.view.facelets.DelegatingMetaTagHandler
delegateFactoryVon Klasse geerbte Felder javax.faces.view.facelets.TagHandler
nextHandler, tag, tagId -
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidapply(javax.faces.view.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent) voidapplyAttachedObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent) This method should create an AjaxBehavior object and attach it to the parent component.protected EventBehaviorcreateBehavior(javax.faces.context.FacesContext context) ViewDeclarationLanguage.retargetAttachedObjects uses it to check if the the target to be processed is applicable for this handlergetFor()The documentation says this attribute should not be used since it is not taken into account.voidonComponentCreated(javax.faces.view.facelets.FaceletContext faceletContext, javax.faces.component.UIComponent component, javax.faces.component.UIComponent parent) Von Klasse geerbte Methoden org.apache.myfaces.tobago.facelets.TobagoComponentHandler
createMetaRuleset, onComponentPopulatedVon Klasse geerbte Methoden javax.faces.view.facelets.ComponentHandler
createComponent, getComponentConfig, getTagHandlerDelegate, isNewVon Klasse geerbte Methoden javax.faces.view.facelets.DelegatingMetaTagHandler
applyNextHandler, getBinding, getTag, getTagAttribute, getTagId, isDisabled, setAttributesVon Klasse geerbte Methoden javax.faces.view.facelets.TagHandler
getAttribute, getRequiredAttribute, toString
-
Felddetails
-
AJAX_BEHAVIOR_LISTENER_SIG
-
-
Konstruktordetails
-
EventHandler
public EventHandler(javax.faces.view.facelets.ComponentConfig config)
-
-
Methodendetails
-
apply
public void apply(javax.faces.view.facelets.FaceletContext ctx, javax.faces.component.UIComponent parent) throws IOException - Angegeben von:
applyin Schnittstellejavax.faces.view.facelets.FaceletHandler- Setzt außer Kraft:
applyin Klassejavax.faces.view.facelets.DelegatingMetaTagHandler- Löst aus:
IOException
-
getEventName
ViewDeclarationLanguage.retargetAttachedObjects uses it to check if the the target to be processed is applicable for this handler- Angegeben von:
getEventNamein Schnittstellejavax.faces.view.BehaviorHolderAttachedObjectHandler
-
applyAttachedObject
public void applyAttachedObject(javax.faces.context.FacesContext context, javax.faces.component.UIComponent parent) This method should create an AjaxBehavior object and attach it to the parent component.Also, it should check if the parent can apply the selected AjaxBehavior to the selected component through ClientBehaviorHolder.getEventNames() or ClientBehaviorHolder.getDefaultEventName()
- Angegeben von:
applyAttachedObjectin Schnittstellejavax.faces.view.AttachedObjectHandler
-
createBehavior
-
onComponentCreated
public void onComponentCreated(javax.faces.view.facelets.FaceletContext faceletContext, javax.faces.component.UIComponent component, javax.faces.component.UIComponent parent) - Setzt außer Kraft:
onComponentCreatedin Klassejavax.faces.view.facelets.ComponentHandler
-
getFor
The documentation says this attribute should not be used since it is not taken into account. Instead, getEventName is used on ViewDeclarationLanguage.retargetAttachedObjects.- Angegeben von:
getForin Schnittstellejavax.faces.view.AttachedObjectHandler
-