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

E81455-02

af:formatString

formatString formatstring


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

The functionality is a greatly reduced version of the java.text.MessageFormat class, supporting indexed based parameter replacement.

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

First parameter will be inserted here: {0}

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{0}

The characters between the braces must be able to be parsed to a valid positive integer.

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

Attributes

Name Type Description
template java.lang.String The template pattern. param0 java.lang.String The value to use to replace the first parameter in the template (designated by {0}).