Class DBCField
- All Implemented Interfaces:
HasHandlers
- Direct Known Subclasses:
DetailViewerField,ListGridField
DataBoundComponent.- See Also:
-
Field Summary
Fields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionPreferred display format to use for date type values within this field.When records from this dataSource are displayed in a dataBoundComponent such as aListGrid, thedisplayFieldattribute may be used to cause some field to display a value from another field in the record.getName()Name of this field.static DBCFieldgetOrCreateRef(JavaScriptObject jsObj) Preferred time-format to apply to date type values within this field.Acom.smartgwt.client.types.ValueMapis a set of legal values for a field.setDateFormatter(DateDisplayFormat dateFormatter) Preferred display format to use for date type values within this field.setDisplayField(String displayField) When records from this dataSource are displayed in a dataBoundComponent such as aListGrid, thedisplayFieldattribute may be used to cause some field to display a value from another field in the record.Name of this field.setTimeFormatter(TimeDisplayFormat timeFormatter) Preferred time-format to apply to date type values within this field.setValueMap(Map valueMap) Acom.smartgwt.client.types.ValueMapis a set of legal values for a field.Methods inherited from class com.smartgwt.client.data.Field
getCanEdit, getCanExport, getEscapeHTML, getExportTitle, getMultiple, getPrimaryKey, getSortByField, getTitle, setCanEdit, setCanExport, setEscapeHTML, setExportTitle, setMultiple, setPrimaryKey, setRequired, setSortByField, setTitleMethods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods 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
-
Constructor Details
-
DBCField
public DBCField() -
DBCField
-
-
Method Details
-
getOrCreateRef
-
setDateFormatter
Preferred display format to use for date type values within this field. If this property is set on a field displayed in a databound component such as aDynamicFormorListGridit will be respected (SeeFormItem.dateFormatterandListGridField.dateFormatter).Note that this property is also honored when exporting directly to Excel spreadsheets (ie, when using XLS or XLSX/OOXML form, not CSV); "date" and "datetime" fields with this property set will deliver real dates and formatting information to Excel, rather than formatted strings or unformatted dates.
Note : This is an advanced setting
- Parameters:
dateFormatter- New dateFormatter value. Default value is null- Returns:
DBCFieldinstance, for chaining setter calls- See Also:
-
getDateFormatter
Preferred display format to use for date type values within this field. If this property is set on a field displayed in a databound component such as aDynamicFormorListGridit will be respected (SeeFormItem.dateFormatterandListGridField.dateFormatter).Note that this property is also honored when exporting directly to Excel spreadsheets (ie, when using XLS or XLSX/OOXML form, not CSV); "date" and "datetime" fields with this property set will deliver real dates and formatting information to Excel, rather than formatted strings or unformatted dates.
- Returns:
- Current dateFormatter value. Default value is null
- See Also:
-
setDisplayField
When records from this dataSource are displayed in a dataBoundComponent such as aListGrid, thedisplayFieldattribute may be used to cause some field to display a value from another field in the record.This is typically used for editable
DataSourceField.foreignKeyfields. In this scenario, a dataSource field has a foreignKey field which stores an ID value used to identify records in another, related dataSource. Rather than display this ID to users, developers may wish to display another, user-friendly field from the related record. This is easy to achieve by having a second field on the dataSource which will be populated with the "display value" from this related dataSource, and usingdataSourceField.displayFieldto show this value. TheDataSourceField.includeFromfeature handles populating this field automatically for dataSources backed by theSmart GWT Server. See the "Editing included fields" section of theDataSourceField.includeFromdocumentation for more on editing included foreignKey fields.Editable dataSourceFields with a specified
displayFieldandforeignKeywill typically be edited using aSelectItemorComboBoxItem. In this case, in addition to identifying the field to use as a static display value within the record being edited,displayFieldwill also identify which field on the related dataSource to use as a display field when showing a set of options to the user. This behavior may be modified in a couple of ways:- The
DataSourceField.foreignDisplayFieldattribute may be used to handle the case where the name of the field used as a displayField within the dataSource is different from the name of the included/equivalent field in the related dataSource. - The
DataSourceField.useLocalDisplayFieldValueattribute may be explicitly set to false to avoid picking up a display value from the local record altogether. Instead the displayField will be used only to derive the display value from a related record from the optionDataSource
FormItem.displayField. - The
-
getDisplayField
When records from this dataSource are displayed in a dataBoundComponent such as aListGrid, thedisplayFieldattribute may be used to cause some field to display a value from another field in the record.This is typically used for editable
DataSourceField.foreignKeyfields. In this scenario, a dataSource field has a foreignKey field which stores an ID value used to identify records in another, related dataSource. Rather than display this ID to users, developers may wish to display another, user-friendly field from the related record. This is easy to achieve by having a second field on the dataSource which will be populated with the "display value" from this related dataSource, and usingdataSourceField.displayFieldto show this value. TheDataSourceField.includeFromfeature handles populating this field automatically for dataSources backed by theSmart GWT Server. See the "Editing included fields" section of theDataSourceField.includeFromdocumentation for more on editing included foreignKey fields.Editable dataSourceFields with a specified
displayFieldandforeignKeywill typically be edited using aSelectItemorComboBoxItem. In this case, in addition to identifying the field to use as a static display value within the record being edited,displayFieldwill also identify which field on the related dataSource to use as a display field when showing a set of options to the user. This behavior may be modified in a couple of ways:- The
DataSourceField.foreignDisplayFieldattribute may be used to handle the case where the name of the field used as a displayField within the dataSource is different from the name of the included/equivalent field in the related dataSource. - The
DataSourceField.useLocalDisplayFieldValueattribute may be explicitly set to false to avoid picking up a display value from the local record altogether. Instead the displayField will be used only to derive the display value from a related record from the optionDataSource
FormItem.displayField.- Returns:
- Current displayField value. Default value is null
- See Also:
- The
-
setName
Name of this field. Must be unique within theDataBoundComponentas well as a valid JavaScript identifier. SeeFieldNamefor details and how to check for validity.The name of the field is usually also the property in each record which holds the record's value for the field.
-
getName
Name of this field. Must be unique within theDataBoundComponentas well as a valid JavaScript identifier. SeeFieldNamefor details and how to check for validity.The name of the field is usually also the property in each record which holds the record's value for the field.
-
setTimeFormatter
Preferred time-format to apply to date type values within this field. If this property is specified on a field displayed within a dataBound component such as aListGridorDynamicForm, any dates displayed in this field will be formatted as times using the appropriate format.This is most commonly only applied to fields specified as type
"time"though if no explicitFormItem.dateFormatteris specified it will be respected for other fields as well.See
ListGridField.timeFormatterandFormItem.timeFormatterfor more information.Note : This is an advanced setting
- Parameters:
timeFormatter- New timeFormatter value. Default value is null- Returns:
DBCFieldinstance, for chaining setter calls- See Also:
-
getTimeFormatter
Preferred time-format to apply to date type values within this field. If this property is specified on a field displayed within a dataBound component such as aListGridorDynamicForm, any dates displayed in this field will be formatted as times using the appropriate format.This is most commonly only applied to fields specified as type
"time"though if no explicitFormItem.dateFormatteris specified it will be respected for other fields as well.See
ListGridField.timeFormatterandFormItem.timeFormatterfor more information.- Returns:
- Current timeFormatter value. Default value is null
- See Also:
-
setValueMap
Acom.smartgwt.client.types.ValueMapis a set of legal values for a field.The valueMap can be specified as either an Array of legal values, or as an
Objectwhere each property maps a stored value to a user-displayable value.To enforce that a field should be constrained to only the values in the valueMap, either declare
field.typeas "enum", or use aValidatorTypeof "isOneOf" with explicitly listed values. Otherwise, although a normalSelectItemcontrol will only allow values from the valueMap to be entered, other controls such as aComboBoxwill allow other values to be entered.In XML, a valueMap that specifies only a list of legal values is specified as follows:
<valueMap> <value>Pens & Pencils</value> <value>Stationery</value> <value>Computer Products</value> <value>Furniture</value> <value>Misc</value> </valueMap>A ValueMap that specifies stored values mapped to user-visible values is specified as follows:<valueMap> <value ID="1">Pens & Pencils</value> <value ID="2">Stationery</value> <value ID="3">Computer Products</value> <value ID="4">Furniture</value> <value ID="5">Misc</value> </valueMap>- Overrides:
setValueMapin classField- Parameters:
valueMap- New valueMap value. Default value is null- Returns:
DBCFieldinstance, for chaining setter calls
-
getValueMap
Acom.smartgwt.client.types.ValueMapis a set of legal values for a field.The valueMap can be specified as either an Array of legal values, or as an
Objectwhere each property maps a stored value to a user-displayable value.To enforce that a field should be constrained to only the values in the valueMap, either declare
field.typeas "enum", or use aValidatorTypeof "isOneOf" with explicitly listed values. Otherwise, although a normalSelectItemcontrol will only allow values from the valueMap to be entered, other controls such as aComboBoxwill allow other values to be entered.In XML, a valueMap that specifies only a list of legal values is specified as follows:
<valueMap> <value>Pens & Pencils</value> <value>Stationery</value> <value>Computer Products</value> <value>Furniture</value> <value>Misc</value> </valueMap>A ValueMap that specifies stored values mapped to user-visible values is specified as follows:<valueMap> <value ID="1">Pens & Pencils</value> <value ID="2">Stationery</value> <value ID="3">Computer Products</value> <value ID="4">Furniture</value> <value ID="5">Misc</value> </valueMap>- Overrides:
getValueMapin classField- Returns:
- Current valueMap value. Default value is null
-