- 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 ofHashParam
andScriptParam
.- 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 State
state
The 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 protected
OnloadParam()
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 void
decodeAll(FacesContext context)
Decode all relevantOnloadParam
components at once.protected void
decodeImmediately(FacesContext context, String submittedValue)
This basically acts as if immediate=true is set to save lifecycle overhead.protected abstract String
getEventValue(FacesContext context)
Returns the value of theOmniFaces.OMNIFACES_EVENT_PARAM_NAME
associated with the current component.protected String
getInitScript(FacesContext context)
Returns script which should be executed upon initialization of a new view.String
getRender()
Returns a space separated string of client IDs to update on ajax response.protected String
getUpdateScript(FacesContext context)
Returns script which should be exeucted upon ajax update of the current view.protected boolean
isOnloadParamRequest(FacesContext context)
Returnstrue
if the current request was invoked by the currentOnloadParam
component.protected static boolean
isOnloadParamRequest(FacesContext context, String onloadEvent)
Returnstrue
if the current request is triggered by an onload param request of the given onload param event.void
processDecodes(FacesContext context)
If this is invoked during an OnloadParam postback, then decode as if immediate=true to save lifecycle overhead.void
processUpdates(FacesContext context)
This override which does effectively nothing prevents Faces from performing update during non-onloadparam postbacks.void
processValidators(FacesContext context)
This override which does effectively nothing prevents Faces from performing validation during non-onloadparam postbacks.void
setRender(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_NAME
associated with the current component.- Parameters:
context
- The involved faces context.- Returns:
- The value of the
OmniFaces.OMNIFACES_EVENT_PARAM_NAME
associated with the current component.
-
isOnloadParamRequest
protected boolean isOnloadParamRequest(FacesContext context)
Returnstrue
if the current request was invoked by the currentOnloadParam
component.- Parameters:
context
- The involved faces context.- Returns:
true
if the current request was invoked by the currentOnloadParam
component.
-
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:
processDecodes
in classUIInput
-
decodeAll
protected abstract void decodeAll(FacesContext context)
Decode all relevantOnloadParam
components 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:
processValidators
in classUIViewParameter
-
processUpdates
public void processUpdates(FacesContext context)
This override which does effectively nothing prevents Faces from performing update during non-onloadparam postbacks.- Overrides:
processUpdates
in 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)
Returnstrue
if 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:
true
if the current request is triggered by an onload param request of the given onload param event.
-
-