public enum FieldType extends java.lang.Enum<FieldType> implements ValueEnum
databound
components
understand and treat specially (using type-specific form controls, validators, formatters, sorting logic,
etc). You can declare custom types via SimpleType.create()
, with
settings that will influence DataBound components. You can also create your own subclasses of databound components to
add further custom, reusable behaviors based on field.type.
field.type
can also be the ID of another
DataSource
, which allows you to model nested structures such as XML documents (in fact,
XMLTools.loadXMLSchema
models XML schema in this way). Nested
DataSource declarations affect how XML and JSON data is deserialized into JavaScript objects in the client-side integration
pipeline, so that you can load complex XML
documents and have them deserialized into a correctly typed JavaScript object model.
Note: to declare related but
separate objects, as in an "Account" object that can be related to both a "Contact" object and "Order" objects,
use foreignKey
, not a nested structure
declaration.
Enum Constant and Description |
---|
ANY
Fields of this type can contain any data value and have no default formatting or validation behavior.
|
BINARY
Arbitrary binary data.
|
BOOLEAN
A boolean value, e.g.
|
CREATOR
Fields of this type are automatically populated by the Smart GWT Server with the current authenticated userId as part of
"add" operations.
|
CREATORTIMESTAMP
Fields of this type are automatically populated by the Smart GWT Server with the current date and time as part of an
"add" operation (when the record is first created).
|
CUSTOM
Synonymous with "any".
|
DATE
A logical date, with no time value (such as a holiday or birthday).
|
DATETIME
A date and time, accurate to the second.
|
ENUM
A text value constrained to a set of legal values specified by the field's
valueMap , as though a ValidatorType of "isOneOf" had been declared. |
FLOAT
A floating point (decimal) number, e.g.
|
IMAGE
A string representing a well-formed URL that points to an image.
|
IMAGEFILE
Binary data comprising an image.
|
INTEGER
A whole number, e.g.
|
INTENUM
An enum whose values are numeric.
|
LINK
A string representing a well-formed URL.
|
LOCALECURRENCY
A float number with locale-based formatting and using currency symbol, e.g.
|
LOCALEFLOAT
A float number with locale-based formatting, e.g.
|
LOCALEINT
An integer number with locale-based formatting, e.g.
|
MODIFIER
Fields of this type are automatically populated by the Smart GWT Server with the current authenticated userId as part of
"add" and "update" operations.
|
MODIFIERTIMESTAMP
Fields of this type are automatically populated by the Smart GWT Server with the current date and time as part of "add"
and "update" operations.
|
NTEXT
A special field type specifically for use with Unicode data in conjunction with the Microsoft SQL Server database.
|
PASSWORD
Same as "text", but causes
PasswordItem to be used by default for
editing (hides typed-in value). |
SEQUENCE
If you are using the Smart GWT SQL datasource connector, a
sequence is a unique, increasing whole number,
incremented whenever a new record is added. |
TEXT
Generic text, e.g.
|
TIME
A time of day, with no date.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getValue() |
static FieldType |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static FieldType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final FieldType TEXT
"John Doe"
. This is the default field type. Use field.length
to set length.public static final FieldType BOOLEAN
true
public static final FieldType INTEGER
123
public static final FieldType FLOAT
1.23
public static final FieldType DATE
Date
object where time values are ignored. See DateFormatAndStorage
for
more information on date display and serialization formats. See also com.smartgwt.client.util.Date
for Smart GWT
extensions to the Date
object.public static final FieldType TIME
Date
object in UTC/GMT by default
(see also DateFormatAndStorage
and the String class).public static final FieldType DATETIME
Date
object. See also
DateFormatAndStorage
and com.smartgwt.client.util.Date
for Smart GWT extensions
to the Date
object.public static final FieldType ENUM
valueMap
, as though a ValidatorType
of "isOneOf" had been declared.public static final FieldType INTENUM
public static final FieldType SEQUENCE
sequence
is a unique, increasing whole number,
incremented whenever a new record is added. Otherwise, sequence
behaves identically to
integer
. This type is typically used with field.primaryKey
to auto-generate unique primary
keys. See also sequenceName
.public static final FieldType LINK
public static final FieldType IMAGE
public static final FieldType BINARY
name
attribute of this field. These fields are marked as hidden
:true
to suppress their rendering by default. You
can show one or more of these fields by specifying the field with a hidden:false
override in the fields
array of the databound component. Stream / view file support for custom DataSources: a custom DataSource or DMI
must implement the "viewFile" and "downloadFile" operationTypes and return a single Record with a byte[] as the field
value for the binary field. For more detail see the overview of Binary
Fields
.public static final FieldType IMAGEFILE
ViewFileItem
to be used when the
field is displayed in a form, allowing the image to optionally be displayed inline.public static final FieldType ANY
parent type
for SimpleTypes where you do not want any
of the standard validation or formatting logic to be inherited from the standard built-in types.public static final FieldType CUSTOM
public static final FieldType MODIFIER
RPCManager
using the setUserId() method, or it can come from the servlet API if you are using
its built-in authentication scheme. See the server-side Javadocs for RPCManager
.public static final FieldType MODIFIERTIMESTAMP
public static final FieldType CREATOR
public static final FieldType CREATORTIMESTAMP
public static final FieldType PASSWORD
PasswordItem
to be used by default for
editing (hides typed-in value).public static final FieldType NTEXT
sqlStorageStrategy
"ntext"; other than that, this type is identical to "text"public static final FieldType LOCALEINT
12,345,678
. See Localized Number Formatting
for more info.public static final FieldType LOCALEFLOAT
12,345.67
. See Localized Number Formatting
for more info.public static final FieldType LOCALECURRENCY
$12,345.67
. See Localized Number Formatting
for more info.public static FieldType[] values()
for (FieldType c : FieldType.values()) System.out.println(c);
public static FieldType valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null