public final class AjaxHandler extends TagHandlerImpl implements jakarta.faces.view.BehaviorHolderAttachedObjectHandler
Enable one or more components in the view to perform Ajax operations. This
tag handler must create an instance of AjaxBehavior using the tag attribute
values.
events attribute for this tag that can be a
ValueExpression must be evaluated at tag execution time since the event name is used in the process of
Behavior creation.ClientBehaviorHolder component:
events attribute value is not specified, obtain the default event name by calling
ClientBehaviorHolder.getDefaultEventName(). If that returns null throw an
exception.events attribute value is specified, ensure it that it exists in the Collection
returned from a call to ClientBehaviorHolder.getEventNames() and throw an exception if it doesn't
exist.AjaxBehavior instance to the ClientBehaviorHolder component by calling
ClientBehaviorHolder.addClientBehavior(java.lang.String, jakarta.faces.component.behavior.ClientBehavior) passing event and the AjaxBehavior instance.UIViewRoot.getComponentResources(). If the Ajax
resource does not exist, create a UIOutput component instance and set the renderer type to
jakarta.faces.resource.Script. Set the the following attributes in the component's attribute
Map: library with the value and
name with the value . Install the component resource
using UIViewRoot.addComponentResource() and specifying head as the target
argument.
If this tag has component children, add the AjaxBehavior to AjaxBehaviors by calling
AjaxBehaviors.pushBehavior(jakarta.faces.context.FacesContext, jakarta.faces.component.behavior.AjaxBehavior, java.lang.String). As subsequent child components that implement the ClientBehaviorHolder
interface are evaluated this AjaxBehavior instance must be added as a behavior to the component.
| Constructor and Description |
|---|
AjaxHandler(jakarta.faces.view.facelets.TagConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
apply(jakarta.faces.view.facelets.FaceletContext ctx,
jakarta.faces.component.UIComponent parent)
Process changes on a particular UIComponent |
void |
applyAttachedObject(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent parent)
Take the argument |
String |
getEventName()
Return the client event name to which this behavior applies. |
String |
getFor()
Return the value of the "for" attribute specified by the page author on the tag for this
|
findNextByType, findNextByTypepublic AjaxHandler(jakarta.faces.view.facelets.TagConfig config)
config - public void apply(jakarta.faces.view.facelets.FaceletContext ctx,
jakarta.faces.component.UIComponent parent)
throws IOException
jakarta.faces.view.facelets.FaceletHandlerProcess changes on a particular UIComponent
apply in interface jakarta.faces.view.facelets.FaceletHandlerctx - the current FaceletContext instance for this executionparent - the parent UIComponent to operate uponIOException - if unable to load relativePathpublic void applyAttachedObject(jakarta.faces.context.FacesContext context,
jakarta.faces.component.UIComponent parent)
jakarta.faces.view.AttachedObjectHandler
Take the argument parent and apply this attached object to it. The action taken varies with class that
implements one of the subinterfaces of this interface.
applyAttachedObject in interface jakarta.faces.view.AttachedObjectHandlercontext - The FacesContext for this requestparent - The UIComponent to which this particular attached object must be applied.public String getFor()
jakarta.faces.view.AttachedObjectHandler
Return the value of the "for" attribute specified by the page author on the tag for this
AttachedObjectHandler.
getFor in interface jakarta.faces.view.AttachedObjectHandlerpublic String getEventName()
jakarta.faces.view.BehaviorHolderAttachedObjectHandlerReturn the client event name to which this behavior applies.
getEventName in interface jakarta.faces.view.BehaviorHolderAttachedObjectHandlerCopyright © 2010–2022 JBoss by Red Hat. All rights reserved.