- Type Parameters:
T- The type of the value.
- All Implemented Interfaces:
PartialStateHolder,StateHolder,TransientStateHolder,ValueHolder,ComponentSystemEventListener,FacesListener,SystemEventListenerHolder,EventListener,ParamHolder<T>
- Direct Known Subclasses:
PathParam
The <o:param> is a component that extends the standard UIParameter to implement ValueHolder
and thus support a Converter to convert the supplied value to string, if necessary.
You can use it the same way as <f:param>, you only need to change f: into
o: to get the extra support for a Converter by usual means via the converter
attribute of the tag, or the nested <f:converter> tag, or just automatically if a converter is
already registered for the target class via @FacesConverter(forClass).
Also, if no value is specified, but children are present, then the encoded output of children will be returned as
param value. This is useful when you want to supply Faces components or HTML as parameter of an unescaped
<h:outputFormat>. For example,
<h:outputFormat value="#{bundle.paragraph}" escape="false">
<o:param><h:link outcome="contact" value="#{bundle.contact}" /></o:param>
</h:outputFormat>
with this bundle
paragraph = Please {0} for more information.
contact = contact us
will result in the link being actually encoded as output format parameter value.
- Since:
- 1.4
- Author:
- Bauke Scholtz
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe component type, which is "org.omnifaces.component.output.Param".Fields inherited from class jakarta.faces.component.UIParameter
COMPONENT_FAMILYFields 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 TypeMethodDescriptionvoidencodeChildren(FacesContext context) Returns the converter, if any.Returns the original, unconverted value of the parameter.booleangetValue()Returns the value of the parameter asString.voidsetConverter(Converter converter) Methods inherited from class jakarta.faces.component.UIParameter
getFacesContext, getFamily, getName, isDisable, setDisable, setName, setRendered, setValueMethods inherited from class jakarta.faces.component.UIComponentBase
addClientBehavior, addFacesListener, broadcast, clearInitialState, decode, encodeAll, encodeBegin, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientBehaviors, getClientId, getDefaultEventName, getEventNames, getFacesListeners, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getPassThroughAttributes, getRenderer, getRendererType, invokeOnComponent, isRendered, isTransient, markInitialState, processDecodes, processRestoreState, processSaveState, processUpdates, processValidators, queueEvent, removeFacesListener, restoreAttachedState, restoreState, saveAttachedState, saveState, setId, setParent, 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 org.omnifaces.component.ParamHolder
getNameMethods inherited from interface jakarta.faces.component.ValueHolder
setValue
-
Field Details
-
COMPONENT_TYPE
The component type, which is "org.omnifaces.component.output.Param".- See Also:
-
-
Constructor Details
-
Param
public Param()
-
-
Method Details
-
getConverter
Description copied from interface:ParamHolderReturns the converter, if any.- Specified by:
getConverterin interfaceParamHolder<T>- Specified by:
getConverterin interfaceValueHolder- Returns:
- The converter, if any.
-
setConverter
- Specified by:
setConverterin interfaceValueHolder
-
getLocalValue
Description copied from interface:ParamHolderReturns the original, unconverted value of the parameter.- Specified by:
getLocalValuein interfaceParamHolder<T>- Specified by:
getLocalValuein interfaceValueHolder- Returns:
- The original, unconverted value of the parameter.
- Throws:
ClassCastException- When actual value is notT.
-
getValue
Description copied from interface:ParamHolderReturns the value of the parameter asString. If the converter is set, or if any converter is available byApplication.createConverter(Class), passing the value's class, then return the result ofConverter.getAsString(jakarta.faces.context.FacesContext, jakarta.faces.component.UIComponent, Object), otherwise return theObject.toString()of the value.- Specified by:
getValuein interfaceParamHolder<T>- Specified by:
getValuein interfaceValueHolder- Overrides:
getValuein classUIParameter- Returns:
- The value of the parameter as
String. - See Also:
-
getRendersChildren
public boolean getRendersChildren()- Overrides:
getRendersChildrenin classUIComponentBase
-
encodeChildren
- Overrides:
encodeChildrenin classUIComponentBase- Throws:
IOException
-