converter - Converter
Defines the data format if it is not string.
Category
dataSyntax
<xp:this.converter>converter</xp:this.converter>
Where converter
is
one of the following:<xp:convertBoolean attributes>content</xp:convertBoolean>
<xp:convertNumber attributes>content</xp:convertNumber>
<xp:convertDateTime attributes>content</xp:convertDateTime>
<xp:convertMask attributes>content</xp:convertMask>
<xp:customConverter></xp:customConverter>
Usage
In Design mode, click the Data tab under Properties and look for Display type, or click All Properties and look for converter under data.Contained properties
Converters have the following properties.Property | Description |
---|---|
|
Whether to create a tag instance at page load. Defaults to true. |
|
Message for the user if strict="true" and
the user enters a value other than true or false .
The message appears at data submission time. |
|
If true, accepts only the input values true and false .
By default, any input value other than true is considered
false. |
Property | Description |
---|---|
|
ISO 4712 currency code, for example, USD . |
|
Currency symbol. |
|
Whether "grouping separators" are used. Defaults to true. |
|
Whether the value is truncated to an integer. Defaults to false. |
|
Whether to create a tag instance at page load. Defaults to true. |
|
A language and country code, for example, en_US . |
|
Maximum digits in the fractional part of a number. |
|
Maximum digits in the integer part of a number. |
|
Minimum digits in the fractional part of a number. |
|
Minimum digits in the integer part of a number. |
|
User-defined pattern for formatting the converted number value. |
|
Formatting for conversion. Defaults
to number . |
Property | Description |
---|---|
|
Predefined formatting for a date value. |
|
Whether to ignore the user time zone in favor of the platform time zone. |
|
Whether to create a tag instance at page load. Defaults to true. |
|
A language and country code, for example, en_US . |
|
User-defined pattern for formatting the converted date-time value. |
|
Predefined formatting for a time value. |
|
Time zone for formatted value, for
example, US/Eastern . |
|
Which part or parts to format. Defaults date . |
Property | Description |
---|---|
|
Whether to remove data other than masked input. Defaults to false. |
|
Whether to create a tag instance at page load. Defaults to true. |
|
Mask characters where # is
a digit placeholder and ? is a letter placeholder. |
Examples
This Edit Box converts its associated data to a number.<xp:inputText id="inputText1" value="#{document1.quantity}">
<xp:this.converter>
<xp:convertNumber type="number"></xp:convertNumber>
</xp:this.converter>
</xp:inputText>
This Edit Box converts its associated
data to a boolean value.
<xp:inputText id="inputText1" value="#{document1.ispublic}">
<xp:this.converter>
<xp:convertBoolean" strict="true" message="Enter true or false for ispublic"></xp:convertBoolean>
</xp:this.converter>
</xp:inputText>