com.smartgwt.client.data

## Class Field

- java.lang.Object
- - com.smartgwt.client.core.JsObject
  - - com.smartgwt.client.core.DataClass
    - - com.smartgwt.client.core.RefDataClass
      - - com.smartgwt.client.data.Field

- All Implemented Interfaces:
    com.google.gwt.event.shared.HasHandlers
  Direct Known Subclasses:
    DataSourceField, DBCField, FormItem

      public class Field
      extends RefDataClass

  Base type representing a field.

  Field container implementations may extend this type with additional attributes and/or methods. For example, `DataSource` uses `DataSourceField`, `DataBoundComponent` uses `DBCField`, and `ListGrid` uses `ListGridField` (itself an extension of `DBCField`).

  In general, `Field` instances should not be shared with multiple field containers.

- - ### Field Summary

    - ### Fields inherited from class com.smartgwt.client.core.RefDataClass

      `id`

    - ### Fields inherited from class com.smartgwt.client.core.DataClass

      `factoryCreated, factoryProperties`

    - ### Fields inherited from class com.smartgwt.client.core.JsObject

      `jsObj`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Field()`
    `Field(com.google.gwt.core.client.JavaScriptObject jsObj)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Boolean` | `getCanEdit()` If set to `true`, then values for the field are considered editable.
    `java.lang.Boolean` | `getCanExport()` If set to `true`, then values for the field are considered exportable.
    `java.lang.Boolean` | `getEscapeHTML()` If set to `true`, then values for the field will be HTML-escaped.
    `java.lang.String` | `getExportTitle()` Optional title HTML to use for the field in exports.
    `java.lang.Boolean` | `getMultiple()` If set to `true`, then the field is array-valued.
    `java.lang.String` | `getName()` Name of the field.
    `static Field` | `getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)`
    `boolean` | `getPrimaryKey()` If set to `true`, indicates that the value for this field (together with the values of any other fields that are also primaryKey:`true`) uniquely identify a record.
    `java.lang.String` | `getSortByField()` If set to a field name, causes the field to be sorted by the values in the specified field, for both client- and server-side sorting.
    `java.lang.String` | `getTitle()` An `HTMLString` to use as the displayable title for this field outside the context of a field container.
    `java.util.Map` | `getValueMap()` If set, specifies the set of legal values for the field.
    `Field` | `setCanEdit(java.lang.Boolean canEdit)` If set to `true`, then values for the field are considered editable.
    `Field` | `setCanExport(java.lang.Boolean canExport)` If set to `true`, then values for the field are considered exportable.
    `Field` | `setEscapeHTML(java.lang.Boolean escapeHTML)` If set to `true`, then values for the field will be HTML-escaped.
    `Field` | `setExportTitle(java.lang.String exportTitle)` Optional title HTML to use for the field in exports.
    `Field` | `setMultiple(java.lang.Boolean multiple)` If set to `true`, then the field is array-valued.
    `Field` | `setName(java.lang.String name)` Name of the field.
    `Field` | `setPrimaryKey(boolean primaryKey)` If set to `true`, indicates that the value for this field (together with the values of any other fields that are also primaryKey:`true`) uniquely identify a record.
    `Field` | `setRequired(java.lang.Boolean required)` If set to `true`, then a value for this field is required to pass validation.
    `Field` | `setSortByField(java.lang.String sortByField)` If set to a field name, causes the field to be sorted by the values in the specified field, for both client- and server-side sorting.
    `Field` | `setTitle(java.lang.String title)` An `HTMLString` to use as the displayable title for this field outside the context of a field container.
    `Field` | `setValueMap(java.util.Map valueMap)` If set, specifies the set of legal values for the field.

    - ### Methods inherited from class com.smartgwt.client.core.RefDataClass

      `getRef, getRef, internalSetID`

    - ### Methods inherited from class com.smartgwt.client.core.DataClass

      `applyFactoryProperties, doAddHandler, fireEvent, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsFloat, getAttributeAsInt, getAttributeAsIntArray, getAttributeAsJavaScriptObject, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsString, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated`

    - ### Methods inherited from class com.smartgwt.client.core.JsObject

      `equals, getJsObj, hashCode, isCreated, setJavaScriptObject, setJsObj`

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

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Field

          public Field()

    - #### Field

          public Field(com.google.gwt.core.client.JavaScriptObject jsObj)

  - ### Method Detail

    - #### getOrCreateRef

          public static Field getOrCreateRef(com.google.gwt.core.client.JavaScriptObject jsObj)

    - #### setCanEdit

          public Field setCanEdit(java.lang.Boolean canEdit)

      If set to `true`, then values for the field are considered editable. If set to `false`, then values for the field cannot be edited. If `null`, then the determination is left to the field container.
      Parameters:
        `canEdit` - New canEdit value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### getCanEdit

          public java.lang.Boolean getCanEdit()

      If set to `true`, then values for the field are considered editable. If set to `false`, then values for the field cannot be edited. If `null`, then the determination is left to the field container.
      Returns:
        Current canEdit value. Default value is null

    - #### setCanExport

          public Field setCanExport(java.lang.Boolean canExport)

      If set to `true`, then values for the field are considered exportable. If set to `false`, then values for the field will not be exported. If `null`, then the determination is left to the field container.
      Parameters:
        `canExport` - New canExport value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### getCanExport

          public java.lang.Boolean getCanExport()

      If set to `true`, then values for the field are considered exportable. If set to `false`, then values for the field will not be exported. If `null`, then the determination is left to the field container.
      Returns:
        Current canExport value. Default value is null

    - #### setEscapeHTML

          public Field setEscapeHTML(java.lang.Boolean escapeHTML)

      If set to `true`, then values for the field will be HTML-escaped.
      Parameters:
        `escapeHTML` - New escapeHTML value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### getEscapeHTML

          public java.lang.Boolean getEscapeHTML()

      If set to `true`, then values for the field will be HTML-escaped.
      Returns:
        Current escapeHTML value. Default value is null

    - #### setExportTitle

          public Field setExportTitle(java.lang.String exportTitle)

      Optional title HTML to use for the field in exports.
      Parameters:
        `exportTitle` - New exportTitle value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls
      See Also:
        `HTMLString`

    - #### getExportTitle

          public java.lang.String getExportTitle()

      Optional title HTML to use for the field in exports.
      Returns:
        Current exportTitle value. Default value is null
      See Also:
        `HTMLString`

    - #### setMultiple

          public Field setMultiple(java.lang.Boolean multiple)

      If set to `true`, then the field is array-valued.
      Parameters:
        `multiple` - New multiple value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### getMultiple

          public java.lang.Boolean getMultiple()

      If set to `true`, then the field is array-valued.
      Returns:
        Current multiple value. Default value is null

    - #### setName

          public Field setName(java.lang.String name)

      Name of the field.
      Parameters:
        `name` - New name value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls
      See Also:
        `FieldName`

    - #### getName

          public java.lang.String getName()

      Name of the field.
      Returns:
        Current name value. Default value is null
      See Also:
        `FieldName`

    - #### setPrimaryKey

          public Field setPrimaryKey(boolean primaryKey)

      If set to `true`, indicates that the value for this field (together with the values of any other fields that are also primaryKey:`true`) uniquely identify a record.

      Note: the case where multiple fields are primary key fields—called "composite" or "multipart" keys—is not recommended by Isomorphic. See `DataSourceField.primaryKey` for more information.

      Parameters:
        `primaryKey` - New primaryKey value. Default value is false
      Returns:
        `Field` instance, for chaining setter calls

    - #### getPrimaryKey

          public boolean getPrimaryKey()

      If set to `true`, indicates that the value for this field (together with the values of any other fields that are also primaryKey:`true`) uniquely identify a record.

      Note: the case where multiple fields are primary key fields—called "composite" or "multipart" keys—is not recommended by Isomorphic. See `DataSourceField.primaryKey` for more information.

      Returns:
        Current primaryKey value. Default value is false

    - #### setRequired

          public Field setRequired(java.lang.Boolean required)

      If set to `true`, then a value for this field is required to pass validation.
      Parameters:
        `required` - New required value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### setSortByField

          public Field setSortByField(java.lang.String sortByField)

      If set to a field name, causes the field to be sorted by the values in the specified field, for both client- and server-side sorting.
      Parameters:
        `sortByField` - New sortByField value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls
      See Also:
        `FieldName`

    - #### getSortByField

          public java.lang.String getSortByField()

      If set to a field name, causes the field to be sorted by the values in the specified field, for both client- and server-side sorting.
      Returns:
        Current sortByField value. Default value is null
      See Also:
        `FieldName`

    - #### setTitle

          public Field setTitle(java.lang.String title)

      An `HTMLString` to use as the displayable title for this field outside the context of a field container.

      Within a `DataBoundComponent`:

      - A field's title may be set with `DataBoundComponent.setFieldTitle()`.
      - Always call the `DataBoundComponent.getFieldTitle()` method to obtain the field's title.
      Parameters:
        `title` - New title value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls
      See Also:
        `setExportTitle(java.lang.String)`, `HTMLString`

    - #### getTitle

          public java.lang.String getTitle()

      An `HTMLString` to use as the displayable title for this field outside the context of a field container.

      Within a `DataBoundComponent`:

      - A field's title may be set with `DataBoundComponent.setFieldTitle()`.
      - Always call the `DataBoundComponent.getFieldTitle()` method to obtain the field's title.
      Returns:
        Current title value. Default value is null
      See Also:
        `getExportTitle()`, `HTMLString`

    - #### setValueMap

          public Field setValueMap(java.util.Map valueMap)

      If set, specifies the set of legal values for the field.
      Parameters:
        `valueMap` - New valueMap value. Default value is null
      Returns:
        `Field` instance, for chaining setter calls

    - #### getValueMap

          public java.util.Map getValueMap()

      If set, specifies the set of legal values for the field.
      Returns:
        Current valueMap value. Default value is null