Apache MyFaces
Documentation
Foundation

Tag reference sheet

Tag library reference for the following tag libraries:

Myfaces Commons Converter Tag Library 2.0. - version 1.1.7

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

Namespace definition: xmlns:mcc="http://myfaces.apache.org/commons/converters"

Tags

  • 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

NameDescriptionType
falseValueValue representing a boolean false, e.g. FALSE, no, 0, etc.String
trueValueValue 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 User: treeder Date: Oct 28, 2005 Time: 7:19:01 PM

Can contain:empty

Attributes

NameDescriptionType
bindingA ValueExpression that evaluates to a DateTimeConverter.String
dateStyleThe style of the date. Values include: default, short, medium, long, and full.String
localeThe name of the locale to be used, instead of the default.String
patternA custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.String
timeStyleThe style of the time. Values include: default, short, medium, long, and full.String
timeZoneThe time zone to use instead of GMT (the default timezone). When this value is a value-binding to a TimeZone instance, that timezone is used. Otherwise this value is treated as a String containing a timezone id, ie as the ID parameter of method java.util.TimeZone.getTimeZone(String).String
typeSpecifies whether the date, time, or both should be parsed/formatted. Values include: date, time, and both. Default based on setting of timeStyle and dateStyle.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

NameDescriptionType
targetClassThe enum class to be used for this converter as referenceString

<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

NameDescriptionType
currencyCodeISO 4217 currency codeString
currencySymbolThe currency symbol used to format a currency value. Defaults to the currency symbol for locale.String
destTypeThe java class name the value should be converted to. Default: automatically determined through valueBindingString
detailMessagealternate conversion error detail message format string (use 'message' and 'detailMessage' alternatively)String
groupingUsedSpecifies whether output will contain grouping separators. Default: true.String
integerOnlySpecifies whether only the integer part of the input will be parsed. Default: false.String
localeThe name of the locale to be used, instead of the default as specified in the faces configuration file.String
maxFractionDigitsThe maximum number of digits in the fractional portion of the number.String
maxIntegerDigitsThe maximum number of digits in the integer portion of the number.String
minFractionDigitsThe minimum number of digits in the fractional portion of the number.String
minIntegerDigitsThe minimum number of digits in the integer portion of the number.String
patternA custom Date formatting pattern, in the format used by java.text.SimpleDateFormat.String
summaryMessagealternate conversion error summary message format stringString
typeThe type of formatting/parsing to be performed. Values include: number, currency, and percentage. Default: number.String