Class Param<T>

  • Type Parameters:
    T - The type of the value.
    All Implemented Interfaces:
    PartialStateHolder, StateHolder, TransientStateHolder, ValueHolder, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener, ParamHolder<T>
    Direct Known Subclasses:

    public class Param<T>
    extends UIParameter
    implements ParamHolder<T>

    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="#{}" /></o:param>

    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.

    Bauke Scholtz
    See Also: