Apache MyFaces
Documentation
Foundation

Tag reference sheet

Tag library reference for the following tag libraries:

Myfaces Commons Converter Tag Library 1.2.

MyFaces subproject that contains converters to be used with any JSF implementation.

This is version 1.1.7.

  • convertBoolean Converter that translates between boolean values (true/false) and alternate versions of those boolean values like (yes/no), (1/0), and (way/no way)
  • convertDateTime Simple convert that overrides the spec DateTimeConverter and uses TimeZone
  • convertEnum Converts a Java 5 Enum
  • convertNumber Converter which uses either the manually set destType or the value binding to determine the correct destination type to convert the number to This tag creates a number formatting converter and associates it with the nearest parent UIComponent

Required attributes are marked with a *

<mcc:convertBoolean>

Converter that translates between boolean values (true/false) and alternate versions of those boolean values like (yes/no), (1/0), and (way/no way). <p/> To customize the representation of a boolean true and false, use {@link #setTrueValue(String)} and {@link #setFalseValue(String)} respectively. If not configured with these setter methods, it defaults to <code>true</code> and <code>false</code>. <p/> The values are case sensitive. <p/>

Can contain: empty

Attributes

Name Description Type
falseValue Value representing a boolean false, e.g. FALSE, no, 0, etc. String
trueValue Value representing a boolean true, e.g. TRUE, yes, 1, etc. String

<mcc:convertDateTime>

Simple convert that overrides the spec DateTimeConverter and uses TimeZone.getDefault() as the base timezone, rather than GMT. Convert date time using normal system timezone like it should

Can contain: empty

Attributes

Name Description Type
dateStyle longDesc = "default|short|medium|long|full" String
locale longDesc = "locale" String
pattern Custom formatting pattern String
timeStyle default|short|medium|long|full String
timeZone timeZome String
type date|time|both String

<mcc:convertEnum>

Converts a Java 5 Enum. see Javadoc of <a href="http://java.sun.com/j2ee/javaserverfaces/1.2/docs/api/index.html">JSF Specification</a>

Can contain: empty

Attributes

Name Description Type
targetClass* The enum class to be used for this converter as reference String

<mcc:convertNumber>

Converter which uses either the manually set <code>destType</code> or the value binding to determine the correct destination type to convert the number to This tag creates a number formatting converter and associates it with the nearest parent UIComponent. It uses either the manually set destType or the value binding to determine the correct destination type to convert the number to. Unless otherwise specified, all attributes accept static values or EL expressions.

Can contain: empty

Attributes

Name Description Type
currencyCode ISO 4217 currency code String
currencySymbol The currency symbol used to format a currency value. Defaults to the currency symbol for locale. String
destType The java class name the value should be converted to. Default: automatically determined through valueBinding String
groupingUsed Specifies whether output will contain grouping separators. Default: true. String
integerOnly Specifies whether only the integer part of the input will be parsed. Default: false. String
locale The name of the locale to be used, instead of the default as specified in the faces configuration file. String
maxFractionDigits The maximum number of digits in the fractional portion of the number. String
maxIntegerDigits The maximum number of digits in the integer portion of the number. String
minFractionDigits The minimum number of digits in the fractional portion of the number. String
minIntegerDigits The minimum number of digits in the integer portion of the number. String
pattern A custom Date formatting pattern, in the format used by java.text.SimpleDateFormat. String
type The type of formatting/parsing to be performed. Values include: number, currency, and percentage. Default: number. String