Package com.smartgwt.client.types

# Enum ListGridFieldType

java.lang.Object
java.lang.Enum<ListGridFieldType>
com.smartgwt.client.types.ListGridFieldType

All Implemented Interfaces:
  `ValueEnum`, `Serializable`, `Comparable<ListGridFieldType>`, `Constable`

public enum ListGridFieldType extends Enum<ListGridFieldType> implements ValueEnum
ListGrids format data for viewing and editing based on the type attribute of the field. This table describes how the ListGrid deals with the various built-in types.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class java.lang.Enum

  `Enum.EnumDesc<E extends Enum<E>>`

- ## Enum Constant Summary

  Enum Constants
  Enum Constant
  Description
  `ANY`
  Fields of this type can contain any data value and have no default formatting or validation behavior.
  `BINARY`
  For viewing, the grid renders a 'view' icon (looking glass) followed by a 'download' icon and then the name of the file is displayed in text.
  `BOOLEAN`
  For viewing and editing a checkbox is shown with a check mark for the `true` value and no check mark for the `false` value.
  `DATE`
  Field value should be a `Date` instance representing a logical date, with no time of day information.
  `DATETIME`
  Field value should be a `Date` instance representing a specific date and time value.
  `FLOAT`
  A floating point (decimal) number, e.g.
  `ICON`
  Shows `field.icon` in every cell, and also in the header.
  `IMAGE`
  Renders a different image in each row based on the value of the field.
  `IMAGEFILE`
  Same as `binary`
  `INTEGER`
  A whole number, e.g.
  `LINK`
  Renders a clickable html link (using an HTML anchor tag: <A>).
  `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.
  `PHONENUMBER`
  A telephone number.
  `SEQUENCE`
  Same as `text`
  `SUMMARY`
  Show a calculated summary based on other field values within the current record.
  `TEXT`
  Simple text rendering for view.
  `TIME`
  Field value should be a `Date` instance representing a logical time, meaning time value that does not have a specific day and also has no timezone.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getValue()`
  `static ListGridFieldType`
  `valueOf(String name)`
  Returns the enum constant of this type with the specified name.
  `static ListGridFieldType[]`
  `values()`
  Returns an array containing the constants of this enum type, in the order they are declared.

  ### Methods inherited from class java.lang.Enum

  `clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

  ### Methods inherited from class java.lang.Object

  `getClass, notify, notifyAll, wait, wait, wait`

- ## Enum Constant Details

  - ### TEXT

    public static final ListGridFieldType TEXT
    Simple text rendering for view. For editing a text entry field is shown. If the length of the field (as specified by the `DataSourceField.length` attribute) is larger than the value specified by `ListGrid.longTextEditorThreshold`, a text input icon is shown that, when clicked on (or field is focused in) opens a larger editor that expands outside the boundaries of the cell (textarea by default, but overrideable via `ListGrid.longTextEditorType`).

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "text".

  - ### BOOLEAN

    public static final ListGridFieldType BOOLEAN
    For viewing and editing a checkbox is shown with a check mark for the `true` value and no check mark for the `false` value. This behavior may be suppressed by setting `ListGridField.suppressValueIcon` for the field. See `ListGrid.booleanTrueImage` for customization.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "boolean".

  - ### INTEGER

    public static final ListGridFieldType INTEGER
    A whole number, e.g. `123`. Consider setting `editorType` to use a `SpinnerItem`.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "integer".

  - ### FLOAT

    public static final ListGridFieldType FLOAT
    A floating point (decimal) number, e.g. `1.23`. Consider setting `editorType` to use a `SpinnerItem`.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "float".

  - ### DATE

    public static final ListGridFieldType DATE
    Field value should be a `Date` instance representing a logical date, with no time of day information. See `DateFormatAndStorage` for details of the logical date type and how it is represented and manipulated.

    Dates will be formatted using `ListGridField.dateFormatter` if specified, otherwise `ListGrid.dateFormatter`. If both these attributes are unset, dates are formatted using the standard `short display format` for dates.

    For editing, by default a `DateItem` is used with `DateItem.useTextField` set to true, providing textual date entry plus a pop-up date picker. The `dateFormatter` and `inputFormat` for the editor will be picked up from the ListGridField, if specified.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "date".

  - ### TIME

    public static final ListGridFieldType TIME
    Field value should be a `Date` instance representing a logical time, meaning time value that does not have a specific day and also has no timezone. See `DateFormatAndStorage` for details of the logical time type and how it is represented and manipulated.

    Times will be formatted using `ListGridField.timeFormatter` if specified, otherwise `ListGrid.timeFormatter`.

    If both these attributes are unset, times are formatted using the standard String for times.

    For editing, by default a `TimeItem` is used. The `timeFormatter` for the editor will be picked up from the ListGridField, if specified.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "time".

  - ### DATETIME

    public static final ListGridFieldType DATETIME
    Field value should be a `Date` instance representing a specific date and time value. See `DateFormatAndStorage` for details of the datetime type and how it is represented and manipulated.

    Dates will be formatted using `ListGridField.dateFormatter` if specified, otherwise `ListGrid.datetimeFormatter`. If both these attributes are unset, dates are formatted using the standard `short display format` for datetime values.

    For editing, by default a `DateTimeItem` is used, providing textual date entry plus a pop-up date picker. The `dateFormatter` and `inputFormat` for the editor will be picked up from the ListGridField, if specified.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "datetime".

  - ### SEQUENCE

    public static final ListGridFieldType SEQUENCE
    Same as `text`

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "sequence".

  - ### LINK

    public static final ListGridFieldType LINK
    Renders a clickable html link (using an HTML anchor tag: <A>). The target URL is the value of the field, which is also the default display value. You can override the display value by setting `ListGridRecord.linkText` or `ListGridField.linkText`.

    Clicking the link opens the URL in a new window by default. To change this behavior, you can set `field.target`, which works identically to the "target" attribute on an HTML anchor (<A>) tag. See `ListGridField.target` for more information.

    In inline edit mode, this type works like a text field.

    Note: When `ListGrid.editEvent` is `"click"`, clicking on a link-type field will follow the link rather than starting inline editing. The click is understood to be intended to navigate to the link target. Editing can still be started via keyboard navigation or by double-clicking if `ListGrid.canEdit` is enabled.

    To create a link not covered by this feature, consider using `ListGridField.setCellFormatter()` along with `Canvas.linkHTML()`, or simply `styling the field` to look like a link, and providing interactivity via `field.recordClick()`.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "link".

  - ### IMAGE

    public static final ListGridFieldType IMAGE
    Renders a different image in each row based on the value of the field. If this URL is not absolute, it is assumed to be relative to `ListGridField.imageURLPrefix` if specified. The size of the image is controlled by `ListGridField.imageSize`, `ListGridField.imageWidth`, `ListGridField.imageHeight` (and by the similarly-named global default attributes on the ListGrid itself).

    You can also specify the following attributes on the field: `activeAreaHTML`, and `extraStuff` - these are passed to `Canvas.imgHTML()` to generate the final URL.

    Note if you want to display icons in addition to the normal cell value, you can use `valueIcons` instead.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "image".

  - ### ICON

    public static final ListGridFieldType ICON
    Shows `field.icon` in every cell, and also in the header. Useful for a field that is used as a button, for example, launches a detail window or removes a row. Implement a `field.recordClick` to define a behavior for the button.

    NOTE: for a field that shows different icons depending on the field value, see `ListGridField.valueIcons`.

    `type:"icon"` also defaults to a small field width, accommodating just the icon with padding, and to a blank header title, so that the header shows the icon only.

    `field.iconWidth` and related properties configure the size of the icon both in the header and in body cells.

    If you want the icon to appear only in body cells and not in the header, set `field.cellIcon` instead, leaving field.icon null.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "icon".

  - ### BINARY

    public static final ListGridFieldType BINARY
    For viewing, the grid renders a 'view' icon (looking glass) followed by a 'download' icon and then the name of the file is displayed in text. If the user clicks the 'view' icon, a new browser window is opened and the file is streamed to that browser instance, using `DataSource.viewFile()`. For images and other file types with known handlers, the content is typically displayed inline - otherwise the browser will ask the user how to handle the content. If the download icon is clicked, `DataSource.downloadFile()` is used to cause the browser to show a "save" dialog. There is no inline editing mode for this field type.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "binary".

  - ### IMAGEFILE

    public static final ListGridFieldType IMAGEFILE
    Same as `binary`

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "imageFile".

  - ### SUMMARY

    public static final ListGridFieldType SUMMARY
    Show a calculated summary based on other field values within the current record. See `ListGridField.recordSummaryFunction` for more information

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "summary".

  - ### ANY

    public static final ListGridFieldType ANY
    Fields of this type can contain any data value and have no default formatting or validation behavior. This is useful as the `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.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "any".

  - ### LOCALEINT

    public static final ListGridFieldType LOCALEINT
    An integer number with locale-based formatting, e.g. `12,345,678`. See `Localized Number Formatting` for more info.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "localeInt".

  - ### LOCALEFLOAT

    public static final ListGridFieldType LOCALEFLOAT
    A float number with locale-based formatting, e.g. `12,345.67`. See `Localized Number Formatting` for more info.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "localeFloat".

  - ### LOCALECURRENCY

    public static final ListGridFieldType LOCALECURRENCY
    A float number with locale-based formatting and using currency symbol, e.g. `$12,345.67`. See `Localized Number Formatting` for more info.

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "localeCurrency".

  - ### PHONENUMBER

    public static final ListGridFieldType PHONENUMBER
    A telephone number. Uses `FormItem.browserInputType` "tel" to hint to the device to restrict input. On most mobile devices that have software keyboards, this cause a specialized keyboard to appear which only allows entry of normal phone numbers. When displayed read-only, a "phoneNumber" renders as an HTML link with the "tel:" URL scheme, which will invoke the native phone dialing interface on most mobile devices. In addition, the CSS style "sc_phoneNumber" is applied.

    By default, "phoneNumber" fields do not include validators, however the following validator definition would limit to digits, dashes and the "+" character: xml:

    <validator type="regexp" expression="^(\(?\+?[0-9]*\)?)?[0-9_\- \(\)]*$" errorMessage="Phone number should be in the correct format e.g. +#(###)###-##-##" />

    or directly in Java:

          RegExpValidator v = new RegExpValidator();
          v.setType(ValidatorType.REGEXP);
          v.setErrorMessage("Phone number should be in the correct format e.g. +#(###)###-##-##");
          v.setExpression("^(\\(?\\+?[0-9]*\\)?)?[0-9_\\- \\(\\)]*$");

    and adding "#" and "*" to the regular expressions above would allow for users to enter special keys sometimes used for extension numbers or pauses

    If this enumerated value is used in a `Component XML` file or server-side DataSource descriptor (.ds.xml file), use the value "phoneNumber".

- ## Method Details

  - ### values

    public static ListGridFieldType[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.
    Returns:
      an array containing the constants of this enum type, in the order they are declared

  - ### valueOf

    public static ListGridFieldType valueOf(String name)
    Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
    Parameters:
      `name` - the name of the enum constant to be returned.
    Returns:
      the enum constant with the specified name
    Throws:
      `IllegalArgumentException` - if this enum type has no constant with the specified name
      `NullPointerException` - if the argument is null

  - ### getValue

    public String getValue()
    Specified by:
      `getValue` in interface `ValueEnum`