Package 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:
  `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
  Description
  `Field()`
  `Field(JavaScriptObject jsObj)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Boolean`
  `getCanEdit()`
  If set to `true`, then values for the field are considered editable.
  `Boolean`
  `getCanExport()`
  If set to `true`, then values for the field are considered exportable.
  `Boolean`
  `getEscapeHTML()`
  If set to `true`, then values for the field will be HTML-escaped.
  `String`
  `getExportTitle()`
  Optional title HTML to use for the field in exports.
  `Boolean`
  `getMultiple()`
  If set to `true`, then the field is array-valued.
  `String`
  `getName()`
  Name of the field.
  `static Field`
  `getOrCreateRef(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.
  `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.
  `String`
  `getTitle()`
  An `HTMLString` to use as the displayable title for this field outside the context of a field container.
  `Map`
  `getValueMap()`
  If set, specifies the set of legal values for the field.
  `Field`
  `setCanEdit(Boolean canEdit)`
  If set to `true`, then values for the field are considered editable.
  `Field`
  `setCanExport(Boolean canExport)`
  If set to `true`, then values for the field are considered exportable.
  `Field`
  `setEscapeHTML(Boolean escapeHTML)`
  If set to `true`, then values for the field will be HTML-escaped.
  `Field`
  `setExportTitle(String exportTitle)`
  Optional title HTML to use for the field in exports.
  `Field`
  `setMultiple(Boolean multiple)`
  If set to `true`, then the field is array-valued.
  `Field`
  `setName(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(Boolean required)`
  If set to `true`, then a value for this field is required to pass validation.
  `Field`
  `setSortByField(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(String title)`
  An `HTMLString` to use as the displayable title for this field outside the context of a field container.
  `Field`
  `setValueMap(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 Details

  - ### Field

    public Field()

  - ### Field

    public Field(JavaScriptObject jsObj)

- ## Method Details

  - ### getOrCreateRef

    public static Field getOrCreateRef(JavaScriptObject jsObj)

  - ### setCanEdit

    public Field setCanEdit(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 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(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 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(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 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(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 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(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 Boolean getMultiple()
    If set to `true`, then the field is array-valued.
    Returns:
      Current multiple value. Default value is null

  - ### setName

    public Field setName(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 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(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(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 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(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 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(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 Map getValueMap()
    If set, specifies the set of legal values for the field.
    Returns:
      Current valueMap value. Default value is null