- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- org.omnifaces.component.script.ScriptFamily
-
- All Implemented Interfaces:
PartialStateHolder
,StateHolder
,TransientStateHolder
,ComponentSystemEventListener
,FacesListener
,SystemEventListenerHolder
,EventListener
- Direct Known Subclasses:
DeferredScript
,OnloadScript
,Socket
public abstract class ScriptFamily extends UIComponentBase
Base class which is to be shared between all components of the Script family.- Author:
- Bauke Scholtz
-
-
Field Summary
Fields Modifier and Type Field Description static String
COMPONENT_FAMILY
The standard component family.-
Fields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, CURRENT_COMPONENT, CURRENT_COMPOSITE_COMPONENT, FACETS_KEY, HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME, VIEW_LOCATION_KEY
-
-
Constructor Summary
Constructors Constructor Description ScriptFamily()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
encodeBegin(FacesContext context)
If this component is rendered, then start the<script>
element.void
encodeEnd(FacesContext context)
If this component is rendered, then end the<script>
element.String
getFamily()
ReturnsCOMPONENT_FAMILY
.boolean
getRendersChildren()
Returnstrue
.protected boolean
moveToBody(ComponentSystemEvent event)
Move this ScriptFamily component to end of body and returnstrue
if done so.-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeChildren, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getValueBinding, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
encodeAll, getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, visitTree
-
-
-
-
Field Detail
-
COMPONENT_FAMILY
public static final String COMPONENT_FAMILY
The standard component family.- See Also:
- Constant Field Values
-
-
Method Detail
-
getFamily
public String getFamily()
ReturnsCOMPONENT_FAMILY
.- Specified by:
getFamily
in classUIComponent
-
getRendersChildren
public boolean getRendersChildren()
Returnstrue
.- Overrides:
getRendersChildren
in classUIComponentBase
-
encodeBegin
public void encodeBegin(FacesContext context) throws IOException
If this component is rendered, then start the<script>
element.- Overrides:
encodeBegin
in classUIComponentBase
- Throws:
IOException
-
encodeEnd
public void encodeEnd(FacesContext context) throws IOException
If this component is rendered, then end the<script>
element.- Overrides:
encodeEnd
in classUIComponentBase
- Throws:
IOException
-
moveToBody
protected boolean moveToBody(ComponentSystemEvent event)
Move this ScriptFamily component to end of body and returnstrue
if done so. This method needs to be called fromUIComponent.processEvent(ComponentSystemEvent)
duringPostAddToViewEvent
orPostRestoreStateEvent
. This has basically the same effect as settingtarget="body"
on a component resource.- Parameters:
event
- The involved event, which can be eitherPostAddToViewEvent
orPostRestoreStateEvent
.- Returns:
true
if the move has taken place.
-
-