- All Implemented Interfaces:
EditableValueHolder,PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener
The <o:componentIdParam> component allows to render just one or more components on a view via a GET
parameter.
Components can be identified via both their client id or simple component id. Via the former it's possible to e.g. render only a specific row in a table. For specific cases, it's possible to render only the parent component and omit any children.
Among the use cases for this is creating simple mashups from various Faces based views, and scripts needing to obtain markup for specific components on an initial (non-faces) request.
Note that this is a rather specialized component and for many common use cases the user is advised to investigate if the existing AJAX and partial page requests in Faces don't already cover the requirements. For the moment this component only supports the direct output of the original markup and does not wrap it into any "partial response" envelope.
- Since:
- 1.1
- Author:
- Arjan Tijms
-
Nested Class Summary
Nested classes/interfaces inherited from class jakarta.faces.component.UIViewParameter
UIViewParameter.Reference -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe component type, which is "org.omnifaces.component.input.ComponentIdParam".Fields inherited from class jakarta.faces.component.UIViewParameter
COMPONENT_FAMILYFields 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_NAMEFields inherited from class jakarta.faces.component.UIComponent
ATTRS_WITH_DECLARED_DEFAULT_VALUES, BEANINFO_KEY, bindings, COMPOSITE_COMPONENT_TYPE_KEY, COMPOSITE_FACET_NAME, FACETS_KEY, VIEW_LOCATION_KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(FacesContext context) Returns the name of the request parameters from which the values are retrieved on an initial request that represent client ids of those components from which the markup should appear in the response (i.e. which should be rendered).Returns the name of the request parameters from which the values are retrieved on an initial request that represent component ids of those components from which the markup should appear in the response (i.e. which should be rendered).booleanReturns whether children of the components identified by clientIdName or componentIdName are rendered in addition to the component itself.voidprocessUpdates(FacesContext context) voidprocessValidators(FacesContext context) voidsetClientIdName(String clientIdName) Sets the name of the request parameters from which the values are retrieved on an initial request that represent client ids of those components from which the markup should appear in the response (i.e. which should be rendered).voidsetComponentIdName(String componentIdName) Sets the name of the request parameters from which the values are retrieved on an initial request that represent component ids of those components from which the markup should appear in the response (i.e. which should be rendered).voidsetRenderChildren(boolean renderChildren) Sets whether children of the components identified by clientIdName or componentIdName are rendered in addition to the component itself.Methods inherited from class org.omnifaces.component.input.ViewParam
getAttributes, getDefault, getStringValueFromModel, getSubmittedValue, isRequired, processDecodes, setDefault, setName, setSubmittedValueMethods inherited from class jakarta.faces.component.UIViewParameter
encodeAll, getConvertedValue, getFacesContext, getFamily, getName, getStringValue, isImmediate, isRendered, updateModelMethods inherited from class jakarta.faces.component.UIInput
addValidator, addValueChangeListener, broadcast, clearInitialState, compareValues, getConverterMessage, getRequiredMessage, getValidatorMessage, getValidators, getValue, getValueChangeListeners, isEmpty, isLocalValueSet, isValid, markInitialState, removeValidator, removeValueChangeListener, resetValue, restoreState, saveState, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setValid, setValidatorMessage, setValue, validate, validateValueMethods inherited from class jakarta.faces.component.UIOutput
getConverter, getLocalValue, setConverterMethods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, encodeBegin, encodeChildren, encodeEnd, findComponent, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, getRendersChildren, invokeOnComponent, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, visitTreeMethods inherited from class jakarta.faces.component.UIComponent
getClientId, getCompositeComponentParent, getContainerClientId, getCurrentComponent, getCurrentCompositeComponent, getListenersForEventClass, getNamingContainer, getPassThroughAttributes, getResourceBundleMap, getStateHelper, getStateHelper, getTransientStateHelper, getTransientStateHelper, getValueExpression, initialStateMarked, isCompositeComponent, isInView, isVisitable, popComponentFromEL, processEvent, pushComponentToEL, restoreTransientState, saveTransientState, setInView, setValueExpression, subscribeToEvent, unsubscribeFromEventMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jakarta.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
-
Field Details
-
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.input.ComponentIdParam".- See Also:
-
-
Constructor Details
-
ComponentIdParam
public ComponentIdParam()
-
-
Method Details
-
decode
- Overrides:
decodein classUIViewParameter
-
processValidators
- Overrides:
processValidatorsin classViewParam
-
processUpdates
- Overrides:
processUpdatesin classUIInput
-
getComponentIdName
Returns the name of the request parameters from which the values are retrieved on an initial request that represent component ids of those components from which the markup should appear in the response (i.e. which should be rendered).- Returns:
- The component id parameter name.
-
setComponentIdName
Sets the name of the request parameters from which the values are retrieved on an initial request that represent component ids of those components from which the markup should appear in the response (i.e. which should be rendered).- Parameters:
componentIdName- The component id parameter name.
-
getClientIdName
Returns the name of the request parameters from which the values are retrieved on an initial request that represent client ids of those components from which the markup should appear in the response (i.e. which should be rendered).- Returns:
- The client id parameter name.
-
setClientIdName
Sets the name of the request parameters from which the values are retrieved on an initial request that represent client ids of those components from which the markup should appear in the response (i.e. which should be rendered).- Parameters:
clientIdName- The client id parameter name.
-
isRenderChildren
public boolean isRenderChildren()Returns whether children of the components identified by clientIdName or componentIdName are rendered in addition to the component itself. Defaults totrue.- Returns:
- Whether children should be rendered.
-
setRenderChildren
public void setRenderChildren(boolean renderChildren) Sets whether children of the components identified by clientIdName or componentIdName are rendered in addition to the component itself. Defaults totrue.- Parameters:
renderChildren- Whether children should be rendered.
-