Oracle Fusion Middleware Tag Reference for Oracle ADF Faces 12c (12.2.1.4.0) E81455-03

# af:formatNamed

formatNamed formatnamed

This function allows a String template to be formated with a single named parameter.

The functionality is a greatly reduced version of the java.text.MessageFormat class, supporting named-parameter replacement instead of index-based replacement.

The only syntax supported by this class is simple name-based replacement, namely:

    First parameter will be inserted here: {first}

Like MessageFormat, escaping using single quotes is supported and therefore, a single quote must be represented using two consecutive single quotes, but the contents of any text between single quotes will not be interpreted. So, the following pattern could be used to include a left bracket:

    some'{'text{first}

The names of the parameters can contain any characters other than single quotes and right braces. Single-quote escaping is also not permitted within keys, so the following is illegal:

    some text{fir'{'st}

<af:outputText value="#{af:formatNamed('Value is {first}', 'first', value)}" />

- af:formatNamed2
- af:formatNamed3
- af:formatNamed4
- af:formatString

## Attributes

Name | Type | Description
--- | --- | ---

template | java.lang.String | The template pattern.
key0 | java.lang.String | The first key of the parameter to replace in the template.
value0 | java.lang.String | The value to use to replace the first parameter in the template (identified by key0's value).