- java.lang.Object
-
- jakarta.faces.component.UIComponent
-
- jakarta.faces.component.UIComponentBase
-
- jakarta.faces.component.UIOutput
-
- jakarta.faces.component.UIInput
-
- jakarta.faces.component.UIViewParameter
-
- org.omnifaces.component.input.OnloadParam
-
- All Implemented Interfaces:
EditableValueHolder,PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
- Direct Known Subclasses:
HashParam,ScriptParam
public abstract class OnloadParam extends UIViewParameter
Base class ofHashParamandScriptParam.- Since:
- 3.6
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jakarta.faces.component.UIViewParameter
UIViewParameter.Reference
-
-
Field Summary
Fields Modifier and Type Field Description protected StatestateThe component state.-
Fields inherited from class jakarta.faces.component.UIViewParameter
COMPONENT_FAMILY, COMPONENT_TYPE
-
Fields inherited from class jakarta.faces.component.UIInput
ALWAYS_PERFORM_VALIDATION_WHEN_REQUIRED_IS_TRUE, CONVERSION_MESSAGE_ID, EMPTY_STRING_AS_NULL_PARAM_NAME, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID, VALIDATE_EMPTY_FIELDS_PARAM_NAME
-
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 Modifier Constructor Description protectedOnloadParam()The constructor instructs Faces to register all scripts during the render response phase if necessary.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voiddecodeAll(FacesContext context)Decode all relevantOnloadParamcomponents at once.protected voiddecodeImmediately(FacesContext context, String submittedValue)This basically acts as if immediate=true is set to save lifecycle overhead.protected abstract StringgetEventValue(FacesContext context)Returns the value of theOmniFaces.OMNIFACES_EVENT_PARAM_NAMEassociated with the current component.protected StringgetInitScript(FacesContext context)Returns script which should be executed upon initialization of a new view.StringgetRender()Returns a space separated string of client IDs to update on ajax response.protected StringgetUpdateScript(FacesContext context)Returns script which should be exeucted upon ajax update of the current view.protected booleanisOnloadParamRequest(FacesContext context)Returnstrueif the current request was invoked by the currentOnloadParamcomponent.protected static booleanisOnloadParamRequest(FacesContext context, String onloadEvent)Returnstrueif the current request is triggered by an onload param request of the given onload param event.voidprocessDecodes(FacesContext context)If this is invoked during an OnloadParam postback, then decode as if immediate=true to save lifecycle overhead.voidprocessUpdates(FacesContext context)This override which does effectively nothing prevents Faces from performing update during non-onloadparam postbacks.voidprocessValidators(FacesContext context)This override which does effectively nothing prevents Faces from performing validation during non-onloadparam postbacks.voidsetRender(String render)Sets a space separated string of client IDs to update on ajax response.-
Methods inherited from class jakarta.faces.component.UIViewParameter
decode, encodeAll, getConvertedValue, getFamily, getName, getStringValue, getStringValueFromModel, getSubmittedValue, isImmediate, setName, setSubmittedValue, updateModel
-
Methods inherited from class jakarta.faces.component.UIInput
addValidator, addValueChangeListener, clearInitialState, compareValues, getConverterMessage, getRequiredMessage, getValidator, getValidatorMessage, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isEmpty, isLocalValueSet, isRequired, isValid, markInitialState, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener, validate, validateValue
-
Methods inherited from class jakarta.faces.component.UIOutput
getConverter, getLocalValue, setConverter
-
Methods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, encodeBegin, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesContext, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getListenersForEventClass, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding, subscribeToEvent, unsubscribeFromEvent
-
Methods inherited from class jakarta.faces.component.UIComponent
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jakarta.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
-
-
-
-
Field Detail
-
state
protected final State state
The component state.
-
-
Method Detail
-
getInitScript
protected String getInitScript(FacesContext context)
Returns script which should be executed upon initialization of a new view.- Parameters:
context- The involved faces context.- Returns:
- Script which should be executed upon initialization of a new view.
-
getUpdateScript
protected String getUpdateScript(FacesContext context)
Returns script which should be exeucted upon ajax update of the current view.- Parameters:
context- The involved faces context.- Returns:
- Script which should be exeucted upon ajax update of the current view.
-
getEventValue
protected abstract String getEventValue(FacesContext context)
Returns the value of theOmniFaces.OMNIFACES_EVENT_PARAM_NAMEassociated with the current component.- Parameters:
context- The involved faces context.- Returns:
- The value of the
OmniFaces.OMNIFACES_EVENT_PARAM_NAMEassociated with the current component.
-
isOnloadParamRequest
protected boolean isOnloadParamRequest(FacesContext context)
Returnstrueif the current request was invoked by the currentOnloadParamcomponent.- Parameters:
context- The involved faces context.- Returns:
trueif the current request was invoked by the currentOnloadParamcomponent.
-
processDecodes
public void processDecodes(FacesContext context)
If this is invoked during an OnloadParam postback, then decode as if immediate=true to save lifecycle overhead.- Overrides:
processDecodesin classUIInput
-
decodeAll
protected abstract void decodeAll(FacesContext context)
Decode all relevantOnloadParamcomponents at once.- Parameters:
context- The involved faces context.
-
decodeImmediately
protected void decodeImmediately(FacesContext context, String submittedValue)
This basically acts as if immediate=true is set to save lifecycle overhead.- Parameters:
context- The involved faces context.submittedValue- The submitted value.
-
processValidators
public void processValidators(FacesContext context)
This override which does effectively nothing prevents Faces from performing validation during non-onloadparam postbacks.- Overrides:
processValidatorsin classUIViewParameter
-
processUpdates
public void processUpdates(FacesContext context)
This override which does effectively nothing prevents Faces from performing update during non-onloadparam postbacks.- Overrides:
processUpdatesin classUIInput
-
getRender
public String getRender()
Returns a space separated string of client IDs to update on ajax response.- Returns:
- A space separated string of client IDs to update on ajax response.
-
setRender
public void setRender(String render)
Sets a space separated string of client IDs to update on ajax response.- Parameters:
render- A space separated string of client IDs to update on ajax response.
-
isOnloadParamRequest
protected static boolean isOnloadParamRequest(FacesContext context, String onloadEvent)
Returnstrueif the current request is triggered by an onload param request of the given onload param event.- Parameters:
context- The involved faces context.onloadEvent- The onload param event.- Returns:
trueif the current request is triggered by an onload param request of the given onload param event.
-
-