|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.smartgwt.client.core.JsObject
com.smartgwt.client.core.DataClass
com.smartgwt.client.core.RefDataClass
com.smartgwt.client.widgets.form.fields.FormItem
com.smartgwt.client.widgets.form.fields.SelectItem
public class SelectItem
FormItem that allows picking between several mutually exclusive options via a select list.
Options may be derived
from a dataSource or a valueMap.
Note that to select the first option as a default value
for the item, defaultToFirstOption
may be set.
com.smartgwt.client.widgets.form.fields.FormItem#getValueMap| Field Summary |
|---|
| Fields inherited from class com.smartgwt.client.core.JsObject |
|---|
jsObj |
| Constructor Summary | |
|---|---|
SelectItem()
|
|
SelectItem(JavaScriptObject jsObj)
|
|
SelectItem(String name)
|
|
SelectItem(String name,
String title)
|
|
| Method Summary | |
|---|---|
HandlerRegistration |
addDataArrivedHandler(DataArrivedHandler handler)
Add a dataArrived handler. |
void |
defaultDynamicValue()
Expression evaluated to determine the defaultValue when no value is provided for this item. |
void |
fetchData()
Only applies to databound items (see optionDataSource).Performs a fetch type operation on this item's DataSource to retrieve the set of valid options for the item, based on the current pickListCriteria. |
void |
fetchData(DSCallback callback)
Only applies to databound items (see optionDataSource).Performs a fetch type operation on this item's DataSource to retrieve the set of valid options for the item, based on the current pickListCriteria. |
void |
fetchData(DSCallback callback,
DSRequest requestProperties)
Only applies to databound items (see optionDataSource).Performs a fetch type operation on this item's DataSource to retrieve the set of valid options for the item, based on the current pickListCriteria. |
ListGridRecord[] |
filterClientPickListData()
Returns the data to display in the pick list. |
Boolean |
getAddUnknownValues()
If we're setting the value of a select item and the value isn't a legal value in the valueMap, whether we should allow the value (creating a new option for it) or reject it. |
Boolean |
getAllowEmptyValue()
If set to true, always show an empty option in this item's pickList, allowing the user to clear the value (even if there is no empty entry in the valueMap for the item). |
Boolean |
getAnimatePickList()
If true, when the pickList is shown, it will be shown via an animated reveal effect |
int |
getAnimationTime()
If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickList |
Boolean |
getAutoFetchData()
If this select item retrieves its options from a dataSource, should options be fetched from the server when
the item is first drawn, or should this fetch be delayed until the user opens the pickList. |
Boolean |
getCachePickListResults()
For databound pickLists (see optionDataSource), by default Smart GWT will cache and re-use datasets shown by pickLists in an LRU (least recently used) caching pattern. |
ListGridRecord[] |
getClientPickListData()
Returns the set of data to be displayed in this item's PickList. |
String |
getControlStyle()
Base CSS class name for a form item's control box (surrounds text box and picker). |
Boolean |
getDefaultToFirstOption()
Select the first option as the default value for this SelectItem. |
Boolean |
getDefaultValue()
Static default value for this SelectItem. |
String |
getDisplayField()
Specifies an alternative field from which display values should be retrieved for this item. |
String |
getDisplayFieldName()
Returns the displayField for this item. |
int |
getEmptyPickListHeight()
Height for an empty pick list (showing the empty message), if the pick list has no records and hideEmptyPickList is false. |
String |
getEmptyPickListMessage()
Empty message to display in the pickList if hideEmptyPickList is false. |
Boolean |
getEscapeHTML()
By default HTML values in a selectItem will be interpreted by the browser. |
Integer |
getFetchDelay()
For a ComboBox or other pickList that accepts user-entered criteria, how many millseconds to wait after the last user keystroke before fetching data from the server. |
Boolean |
getFetchDisplayedFieldsOnly()
If this item has a specified optionDataSource and this property is true, the list of fields
used by this pickList will be passed to the datasource as outputs. |
Boolean |
getFilterLocally()
If filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. |
int |
getHeight()
Default height for select items is 19px. |
Boolean |
getHideEmptyPickList()
If this pickList contains no options, should it be hidden? If unset, default behavior is to allow the empty pickList to show if it is databound. |
Boolean |
getMultiple()
If true, multiple values may be selected. |
MultipleAppearance |
getMultipleAppearance()
How should items with multiple set to 'true' be
displayed? |
DataSource |
getOptionDataSource()
|
String |
getOptionOperationId()
If this item has a specified optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
static SelectItem |
getOrCreateRef(JavaScriptObject jsObj)
|
Integer |
getPickerIconHeight()
If showPickerIcon is true for this item,
this property governs the size of the picker icon. |
String |
getPickerIconSrc()
If showPickerIcon is true for this item,
this property governs the src of the picker icon image to be displayed. |
String |
getPickerIconStyle()
Base CSS class name for a form item's picker icon cell. |
Integer |
getPickerIconWidth()
If showPickerIcon is true for this item,
this property governs the size of the picker icon. |
String |
getPickListBaseStyle()
Base Style for pickList cells. |
Criteria |
getPickListCriteria()
If this item has a databound pickList (for example optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList. |
protected Criteria |
getPickListFilterCriteria()
Returns a set of filter criteria to be applied to the data displayed in the pickList when it is shown. |
int |
getPickListHeaderHeight()
If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. |
int |
getPickListHeight()
Maximum height to show the pick list before it starts to scroll. |
Integer |
getPickListWidth()
Default width to show the pickList. |
Boolean |
getProgressiveLoading()
Indicates whether or not this SelectItem will load its list of options progressively. |
Boolean |
getSaveOnEnter()
Select items will submit their containing form on enter keypress if saveOnEnter is true. |
ListGridRecord |
getSelectedRecord()
Returns the entire record object associated with the current value for this item (or null if no matching record exists in the PickList data). |
ListGridRecord[] |
getSelectedRecords()
For a SelectItem with an setOptionDataSource(com.smartgwt.client.data.DataSource) optionDataSource} and allowing multiple
selection multiple :true, returns the list of currently selected records, or null if none are selected. |
Boolean |
getShowAllOptions()
If true, even non-matching options will be shown, with configurable separatorRows in between. |
Boolean |
getShowFocused()
When this item receives focus, should it be re-styled to indicate it has focus? |
Boolean |
getShowHintInField()
If showing a hint for this form item, should it be shown within the field? |
Boolean |
getShowOptionsFromDataSource()
If this item is part of a databound form, and has a specified valueMap, by default we show the valueMap
options in the pickList for the item. |
Boolean |
getShowOver()
When the user rolls over the select item, should the pickButton display it's Over state? |
Boolean |
getShowPickerIcon()
Should we show a special 'picker' icon for this form item. |
String |
getSortField()
Specifies the field by which this item should be initially sorted. |
Integer |
getSortFieldAsInt()
Specifies the field by which this item should be initially sorted. |
String |
getTextBoxStyle()
Base CSS class name for a form item's text box element. |
TextMatchStyle |
getTextMatchStyle()
When applying filter criteria to pickList data, what type of matching to use. |
String |
getValueAsString()
Return the value tracked by this form item. |
String |
getValueField()
If this form item maps data values to display values by retrieving the displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
String |
getValueFieldName()
Getter method to retrieve the valueField for this
item. |
String |
getValueIconField()
For Databound formItems, this property determines which column valueIcons should show up in for this formItem's pickList.If unset valueIcons show up in the displayField column if specified, otherwise
the valueField column.In most cases only the displayField or valueField will be visible. |
String[] |
getValues()
Returns the values of a SelectItem with multiple=true as an array of Strings. |
Boolean |
isMultiple()
If true, multiple values may be selected. |
void |
setAddUnknownValues(Boolean addUnknownValues)
If we're setting the value of a select item and the value isn't a legal value in the valueMap, whether we should allow the value (creating a new option for it) or reject it. |
void |
setAllowEmptyValue(Boolean allowEmptyValue)
If set to true, always show an empty option in this item's pickList, allowing the user to clear the value (even if there is no empty entry in the valueMap for the item). |
void |
setAnimatePickList(Boolean animatePickList)
If true, when the pickList is shown, it will be shown via an animated reveal effect |
void |
setAnimationTime(int animationTime)
If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickList |
void |
setAutoFetchData(Boolean autoFetchData)
If this select item retrieves its options from a dataSource, should options be fetched from the server when
the item is first drawn, or should this fetch be delayed until the user opens the pickList. |
void |
setCachePickListResults(Boolean cachePickListResults)
For databound pickLists (see optionDataSource), by default Smart GWT will cache and re-use datasets shown by pickLists in an LRU (least recently used) caching pattern. |
void |
setControlStyle(String controlStyle)
Base CSS class name for a form item's control box (surrounds text box and picker). |
void |
setDefaultToFirstOption(Boolean defaultToFirstOption)
Select the first option as the default value for this SelectItem. |
void |
setDefaultValue(Boolean defaultValue)
Static default value for this SelectItem. |
void |
setDefaultValues(Integer... defaultValues)
Default values used when no value is provided for this item. |
void |
setDefaultValues(String... defaultValues)
Default values used when no value is provided for this item. |
void |
setDisplayField(String displayField)
Specifies an alternative field from which display values should be retrieved for this item. |
void |
setEmptyPickListHeight(int emptyPickListHeight)
Height for an empty pick list (showing the empty message), if the pick list has no records and hideEmptyPickList is false. |
void |
setEmptyPickListMessage(String emptyPickListMessage)
Empty message to display in the pickList if hideEmptyPickList is false. |
void |
setEscapeHTML(Boolean escapeHTML)
By default HTML values in a selectItem will be interpreted by the browser. |
void |
setFetchDelay(Integer fetchDelay)
For a ComboBox or other pickList that accepts user-entered criteria, how many millseconds to wait after the last user keystroke before fetching data from the server. |
void |
setFetchDisplayedFieldsOnly(Boolean fetchDisplayedFieldsOnly)
If this item has a specified optionDataSource and this property is true, the list of fields
used by this pickList will be passed to the datasource as outputs. |
void |
setFields(FormItemIcon pickerIconProperties)
|
void |
setFilterLocally(Boolean filterLocally)
If filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. |
void |
setHeight(int height)
Default height for select items is 19px. |
void |
setHideEmptyPickList(Boolean hideEmptyPickList)
If this pickList contains no options, should it be hidden? If unset, default behavior is to allow the empty pickList to show if it is databound. |
void |
setJavaScriptObject(JavaScriptObject jsObj)
|
void |
setMultiple(Boolean multiple)
If true, multiple values may be selected. |
void |
setMultipleAppearance(MultipleAppearance multipleAppearance)
How should items with multiple set to 'true' be
displayed? |
void |
setOptionDataSource(DataSource dataSource)
If set, this FormItem will derive data to show in the PickList by fetching records from the specified optionDataSource. |
void |
setOptionFilterContext(DSRequest dsRequestProperties)
If this item has a specified optionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping |
void |
setOptionOperationId(String optionOperationId)
If this item has a specified optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping. |
void |
setPickerIconHeight(Integer pickerIconHeight)
If showPickerIcon is true for this item,
this property governs the size of the picker icon. |
void |
setPickerIconSrc(String pickerIconSrc)
If showPickerIcon is true for this item,
this property governs the src of the picker icon image to be displayed. |
void |
setPickerIconStyle(String pickerIconStyle)
Base CSS class name for a form item's picker icon cell. |
void |
setPickerIconWidth(Integer pickerIconWidth)
If showPickerIcon is true for this item,
this property governs the size of the picker icon. |
void |
setPickListBaseStyle(String pickListBaseStyle)
Base Style for pickList cells. |
void |
setPickListCriteria(Criteria pickListCriteria)
If this item has a databound pickList (for example optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList. |
void |
setPickListCriteria(DSRequest optionFilterContext)
If this item has a specified optionDataSource, and this property is not null, this will be passed to
the datasource as RPCRequest properties when performing the filter operation on
the dataSource to obtain the set of options for the list. |
void |
setPickListFields(ListGridField... pickListFields)
This property allows the developer to specify which field[s] will be displayed in the drop down list of options. |
void |
setPickListFilterCriteriaFunction(FilterCriteriaFunction filterCriteriaFunction)
Deprecated. in favor of setPickListFilterCriteriaFunction(FormItemCriteriaFunction) |
void |
setPickListFilterCriteriaFunction(FormItemCriteriaFunction filterCriteriaFunction)
Set up a method to return filter criteria for options displayed for this item. |
void |
setPickListHeaderHeight(int pickListHeaderHeight)
If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. |
void |
setPickListHeight(int pickListHeight)
Maximum height to show the pick list before it starts to scroll. |
void |
setPickListProperties(ListGrid pickListProperties)
Set the properties to be applied to the pickList created for this Form Item. |
void |
setPickListSort(SortSpecifier[] sortSpecifiers)
This method sorts the pickList on one or more fields, creating the underlying JS object if needed. |
void |
setPickListWidth(Integer pickListWidth)
Default width to show the pickList. |
void |
setProgressiveLoading(Boolean progressiveLoading)
Indicates whether or not this SelectItem will load its list of options progressively. |
void |
setSaveOnEnter(Boolean saveOnEnter)
Select items will submit their containing form on enter keypress if saveOnEnter is true. |
void |
setSeparatorRows(ListGridRecord[] separatorRows)
Array of records to show between matching and non-matching rows in the PickList. |
void |
setShowAllOptions(Boolean showAllOptions)
If true, even non-matching options will be shown, with configurable separatorRows in between. |
void |
setShowFocused(Boolean showFocused)
When this item receives focus, should it be re-styled to indicate it has focus? |
void |
setShowHintInField(Boolean showHintInField)
If showing a hint for this form item, should it be shown within the field? |
void |
setShowOptionsFromDataSource(Boolean showOptionsFromDataSource)
If this item is part of a databound form, and has a specified valueMap, by default we show the valueMap
options in the pickList for the item. |
void |
setShowOver(Boolean showOver)
When the user rolls over the select item, should the pickButton display it's Over state? |
void |
setShowPickerIcon(Boolean showPickerIcon)
Should we show a special 'picker' icon for this form item. |
void |
setSortField(Integer sortField)
Specifies the field by which this item should be initially sorted. |
void |
setSortField(String sortField)
Specifies the field by which this item should be initially sorted. |
void |
setTextBoxStyle(String textBoxStyle)
Base CSS class name for a form item's text box element. |
void |
setTextMatchStyle(TextMatchStyle textMatchStyle)
When applying filter criteria to pickList data, what type of matching to use. |
void |
setValueField(String valueField)
If this form item maps data values to display values by retrieving the displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.If unset, assumed to be the name of this form item. |
void |
setValueIconField(String valueIconField)
For Databound formItems, this property determines which column valueIcons should show up in for this formItem's pickList.If unset valueIcons show up in the displayField column if specified, otherwise
the valueField column.In most cases only the displayField or valueField will be visible. |
void |
setValues(String... values)
Set the values of a SelectItem with multiple=true. |
void |
showPicker()
Method to show a picker for this item. |
| Methods inherited from class com.smartgwt.client.core.RefDataClass |
|---|
getRef, getRef |
| Methods inherited from class com.smartgwt.client.core.DataClass |
|---|
doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, getJsObj, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute |
| Methods inherited from class com.smartgwt.client.core.JsObject |
|---|
setJsObj |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
|---|
fireEvent |
| Constructor Detail |
|---|
public SelectItem()
public SelectItem(JavaScriptObject jsObj)
public SelectItem(String name)
public SelectItem(String name,
String title)
| Method Detail |
|---|
public static SelectItem getOrCreateRef(JavaScriptObject jsObj)
public void setJavaScriptObject(JavaScriptObject jsObj)
setJavaScriptObject in class FormItempublic void setAddUnknownValues(Boolean addUnknownValues)
Exception: If the value is set to null but there
is no null entry in the valueMap for this item, setting addUnknownValues to true will not cause a null
option to show up at the top of the select item pickList. Whether an empty option is shown in the pickList is governed
by allowEmptyValue instead.
Note : This is an advanced setting
addUnknownValues - addUnknownValues Default value is truepublic Boolean getAddUnknownValues()
Exception: If the value is set to null but there
is no null entry in the valueMap for this item, setting addUnknownValues to true will not cause a null
option to show up at the top of the select item pickList. Whether an empty option is shown in the pickList is governed
by allowEmptyValue instead.
public void setAllowEmptyValue(Boolean allowEmptyValue)
The empty value will be displayed with the emptyDisplayValue.
With a databound selectItem, enabling
allowEmptyValue disables data paging - all data matching the current criteria will be requested.
allowEmptyValue - allowEmptyValue Default value is falsepublic Boolean getAllowEmptyValue()
The empty value will be displayed with the emptyDisplayValue.
With a databound selectItem, enabling
allowEmptyValue disables data paging - all data matching the current criteria will be requested.
public void setAutoFetchData(Boolean autoFetchData)
dataSource, should options be fetched from the server when
the item is first drawn, or should this fetch be delayed until the user opens the pickList. The default is true in order to allow the user to select a value via keyboard input while keyboard focus is on the SelectItem but the pickList has not actually been shown.
Note : This is an advanced setting
autoFetchData - autoFetchData Default value is truepublic Boolean getAutoFetchData()
dataSource, should options be fetched from the server when
the item is first drawn, or should this fetch be delayed until the user opens the pickList. The default is true in order to allow the user to select a value via keyboard input while keyboard focus is on the SelectItem but the pickList has not actually been shown.
public void setCachePickListResults(Boolean cachePickListResults)
Setting this flag to false avoids this caching for situations where it is too aggressive.
cachePickListResults - cachePickListResults Default value is truepublic Boolean getCachePickListResults()
Setting this flag to false avoids this caching for situations where it is too aggressive.
public void setControlStyle(String controlStyle)
NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.
controlStyle - . See FormItemBaseStyle. Default value is "selectItemControl", [IRA]FormItem.setCellStyle(java.lang.String),
Appearance overview and related methodspublic String getControlStyle()
NOTE: See the CompoundFormItem_skinning discussion for special skinning considerations.
FormItemBaseStyleFormItem.getCellStyle(),
Appearance overview and related methodspublic void setDefaultToFirstOption(Boolean defaultToFirstOption)
If options are derived from a dataSource, the first value returned by the server will be used, otherwise the first value in the valueMap. Note that setting this property to true will trigger a fetch at soon as the form is created, because the form will try to establish a default value at that time.
If enabled, this setting overrides defaultValue and SelectItem.defaultDynamicValue.
defaultToFirstOption - defaultToFirstOption Default value is falsepublic Boolean getDefaultToFirstOption()
If options are derived from a dataSource, the first value returned by the server will be used, otherwise the first value in the valueMap. Note that setting this property to true will trigger a fetch at soon as the form is created, because the form will try to establish a default value at that time.
If enabled, this setting overrides defaultValue and SelectItem.defaultDynamicValue.
public void setDefaultValue(Boolean defaultValue)
defaultToFirstOption instead.
setDefaultValue in class FormItemdefaultValue - defaultValue Default value is nullpublic Boolean getDefaultValue()
defaultToFirstOption instead.
public void setDisplayField(String displayField)
The display field can be
either another field value in the same record or a field that must be retrieved from a related optionDataSource.
If this item is not
databound (optionDataSource is unset), or
bound to the same dataSource as the form as a whole, this item will call form.getValue() the form named after is implemented by picking
up the value of the specified field from the Form's values object.
Otherwise this item will attempt to map its
underlying value to a display value by retrieving a record from the optionDataSource where the valueField matches this item's value, and displaying the
displayField value from that record. Note that if optionDataSource is set and this value is
not set, FormItem.getDisplayFieldName will
return the dataSource title field by default.
This essentially enables the specified optionDataSource
to be used as a server based valueMap.
setDisplayField in interface PickListsetDisplayField in class FormItemdisplayField - . See String. Default value is nullpublic String getDisplayField()
The display field can be
either another field value in the same record or a field that must be retrieved from a related optionDataSource.
If this item is not
databound (optionDataSource is unset), or
bound to the same dataSource as the form as a whole, this item will call form.getValue() the form named after is implemented by picking
up the value of the specified field from the Form's values object.
Otherwise this item will attempt to map its
underlying value to a display value by retrieving a record from the optionDataSource where the valueField matches this item's value, and displaying the
displayField value from that record. Note that if optionDataSource is set and this value is
not set, FormItem.getDisplayFieldName will
return the dataSource title field by default.
This essentially enables the specified optionDataSource
to be used as a server based valueMap.
getDisplayField in interface PickListgetDisplayField in class FormItemStringpublic void setEscapeHTML(Boolean escapeHTML)
"<b>AAA</b>") is
displayed to the user rather than the interpreted HTML (for example "AAA")
escapeHTML - escapeHTML Default value is falseAppearance overview and related methodspublic Boolean getEscapeHTML()
"<b>AAA</b>") is
displayed to the user rather than the interpreted HTML (for example "AAA")
Appearance overview and related methodspublic void setFetchDisplayedFieldsOnly(Boolean fetchDisplayedFieldsOnly)
optionDataSource and this property is true, the list of fields
used by this pickList will be passed to the datasource as outputs.
If the datasource supports this feature the returned fields will be limited to this list. A custom datasource will need
to add code to implement field limiting. This list of used fields consists of the values of valueField, displayField and pickListFields.
NOTE: When enabled, getSelectedRecord will only include the fetched
fields.
Note : This is an advanced setting
fetchDisplayedFieldsOnly - fetchDisplayedFieldsOnly Default value is nullpublic Boolean getFetchDisplayedFieldsOnly()
optionDataSource and this property is true, the list of fields
used by this pickList will be passed to the datasource as outputs.
If the datasource supports this feature the returned fields will be limited to this list. A custom datasource will need
to add code to implement field limiting. This list of used fields consists of the values of valueField, displayField and pickListFields.
NOTE: When enabled, getSelectedRecord will only include the fetched
fields.
public void setFilterLocally(Boolean filterLocally)
filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. Also
use "local" type filtering on drop down list of options. This means data will only be fetched once from the server, and then filtered on the client.
Note : This is an advanced setting
setFilterLocally in interface PickListsetFilterLocally in class FormItemfilterLocally - filterLocally Default value is falseFormItem.setFilterLocally(java.lang.Boolean)public Boolean getFilterLocally()
filterLocally is set for this item, and this item is showing options from a dataSource, fetch the
entire set of options from the server, and use these values to map the item value to the appropriate display value. Also
use "local" type filtering on drop down list of options. This means data will only be fetched once from the server, and then filtered on the client.
getFilterLocally in interface PickListgetFilterLocally in class FormItemFormItem.getFilterLocally()public void setHeight(int height)
setHeight in class FormItemheight - height Default value is 19Appearance overview and related methodspublic int getHeight()
getHeight in class FormItemAppearance overview and related methodspublic void setMultiple(Boolean multiple)
The SelectItem will either render as a drop-down allowing multiple
selections, or a multi-row list of options similar to a small headerless ListGrid, based on the MultipleAppearance setting.
The logical value of the formItem, as retrieved by getValue() and set via setValue(), is an Array of
Strings reflecting the selected values.
When this value is true, we disable doubleClick events by default, instead
issuing two single clicks by forcibly setting noDoubleClicks: true. If you need to work with doubleClick events, you can disable this default behavior by explicitly
setting formItem.pickListProperties.noDoubleClicks: false.
Note: multiple:true SelectItems do not
currently support optionDataSource binding. You can get around this by calling DataSource.fetchData directly and calling dsResponse.data.getValueMap() to obtain a valueMap.
multiple - multiple Default value is falseAppearance overview and related methodspublic Boolean getMultiple()
The SelectItem will either render as a drop-down allowing multiple
selections, or a multi-row list of options similar to a small headerless ListGrid, based on the MultipleAppearance setting.
The logical value of the formItem, as retrieved by getValue() and set via setValue(), is an Array of
Strings reflecting the selected values.
When this value is true, we disable doubleClick events by default, instead
issuing two single clicks by forcibly setting noDoubleClicks: true. If you need to work with doubleClick events, you can disable this default behavior by explicitly
setting formItem.pickListProperties.noDoubleClicks: false.
Note: multiple:true SelectItems do not
currently support optionDataSource binding. You can get around this by calling DataSource.fetchData directly and calling dsResponse.data.getValueMap() to obtain a valueMap.
Appearance overview and related methodspublic void setMultipleAppearance(MultipleAppearance multipleAppearance)
multiple set to 'true' be
displayed?
multipleAppearance - multipleAppearance Default value is "picklist"public MultipleAppearance getMultipleAppearance()
multiple set to 'true' be
displayed?
public void setOptionOperationId(String optionOperationId)
optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping.
setOptionOperationId in class FormItemoptionOperationId - . See String. Default value is nullpublic String getOptionOperationId()
optionDataSource, this attribute may be set to specify an explicit operationId when performing a fetch against the option dataSource to
pick up display value mapping.
getOptionOperationId in class FormItemStringpublic void setPickerIconHeight(Integer pickerIconHeight)
showPickerIcon is true for this item,
this property governs the size of the picker icon. If unset, the picker icon will be sized as a square to fit in the
available height for the icon.
Note : This is an advanced setting
setPickerIconHeight in class FormItempickerIconHeight - pickerIconHeight Default value is nullpublic Integer getPickerIconHeight()
showPickerIcon is true for this item,
this property governs the size of the picker icon. If unset, the picker icon will be sized as a square to fit in the
available height for the icon.
getPickerIconHeight in class FormItempublic void setPickerIconSrc(String pickerIconSrc)
showPickerIcon is true for this item,
this property governs the src of the picker icon image to be displayed.
Note : This is an advanced setting
setPickerIconSrc in class FormItempickerIconSrc - . See SCImgURL. Default value is "[SKIN]/DynamicForm/SelectItem_PickButton_icon.gif"public String getPickerIconSrc()
showPickerIcon is true for this item,
this property governs the src of the picker icon image to be displayed.
getPickerIconSrc in class FormItemSCImgURLpublic void setPickerIconStyle(String pickerIconStyle)
controlStyle.
pickerIconStyle - . See FormItemBaseStyle. Default value is "selectItemPickerIcon", [IRA]setControlStyle(java.lang.String),
Appearance overview and related methodspublic String getPickerIconStyle()
controlStyle.
FormItemBaseStylegetControlStyle(),
Appearance overview and related methodspublic void setPickerIconWidth(Integer pickerIconWidth)
showPickerIcon is true for this item,
this property governs the size of the picker icon. If unset, the picker icon will be sized as a square to fit in the
available height for the icon.
Note : This is an advanced setting
setPickerIconWidth in class FormItempickerIconWidth - pickerIconWidth Default value is nullpublic Integer getPickerIconWidth()
showPickerIcon is true for this item,
this property governs the size of the picker icon. If unset, the picker icon will be sized as a square to fit in the
available height for the icon.
getPickerIconWidth in class FormItempublic void setPickListCriteria(Criteria pickListCriteria)
Note : This is an advanced setting
setPickListCriteria in interface PickListpickListCriteria - pickListCriteria Default value is nullpublic Criteria getPickListCriteria()
getPickListCriteria in interface PickListpublic void setProgressiveLoading(Boolean progressiveLoading)
progressively. This property is copied onto the underlying
PickList.
progressiveLoading - progressiveLoading Default value is nullDataSource.setProgressiveLoading(java.lang.Boolean),
ProgressiveLoading overview and related methodspublic Boolean getProgressiveLoading()
progressively. This property is copied onto the underlying
PickList.
DataSource.getProgressiveLoading(),
ProgressiveLoading overview and related methodspublic void setSaveOnEnter(Boolean saveOnEnter)
saveOnEnter is true. Setting this property to
false will disable this behavior. Note that if the drop down list of options (pickList) is visible an
Enter keypress is used to select a value from the available set of options and will not automatically cause
form submission.
setSaveOnEnter in class FormItemsaveOnEnter - saveOnEnter Default value is truepublic Boolean getSaveOnEnter()
saveOnEnter is true. Setting this property to
false will disable this behavior. Note that if the drop down list of options (pickList) is visible an
Enter keypress is used to select a value from the available set of options and will not automatically cause
form submission.
getSaveOnEnter in class FormItempublic void setShowFocused(Boolean showFocused)
Note : This is an advanced setting
setShowFocused in class FormItemshowFocused - showFocused Default value is true, [IRWA]FormItem.setCellStyle(java.lang.String),
Appearance overview and related methodspublic Boolean getShowFocused()
getShowFocused in class FormItemFormItem.getCellStyle(),
Appearance overview and related methodspublic void setShowHintInField(Boolean showHintInField)
CSS style for the hint is textBoxStyle with the suffix "Hint" appended to it.
Note : This is an advanced setting
showHintInField - showHintInField Default value is nullFormItem.setHint(java.lang.String),
Appearance overview and related methodspublic Boolean getShowHintInField()
CSS style for the hint is textBoxStyle with the suffix "Hint" appended to it.
FormItem.getHint(),
Appearance overview and related methodspublic void setShowOptionsFromDataSource(Boolean showOptionsFromDataSource)
valueMap, by default we show the valueMap
options in the pickList for the item. Setting this property to true will ensure that the options displayed in our
pickList are derived from the form's dataSource.
Note : This is an advanced setting
setShowOptionsFromDataSource in interface PickListshowOptionsFromDataSource - showOptionsFromDataSource Default value is nullDatabinding overview and related methodspublic Boolean getShowOptionsFromDataSource()
valueMap, by default we show the valueMap
options in the pickList for the item. Setting this property to true will ensure that the options displayed in our
pickList are derived from the form's dataSource.
getShowOptionsFromDataSource in interface PickListDatabinding overview and related methodspublic void setShowOver(Boolean showOver)
Over state?
Note : This is an advanced setting
showOver - showOver Default value is truepublic Boolean getShowOver()
Over state?
public void setShowPickerIcon(Boolean showPickerIcon)
pickerIconProperties. By default they will
be rendered inside the Form Item's "control box" area, and will call SelectItem.showPicker when clicked.
setShowPickerIcon in class FormItemshowPickerIcon - showPickerIcon Default value is truepublic Boolean getShowPickerIcon()
pickerIconProperties. By default they will
be rendered inside the Form Item's "control box" area, and will call SelectItem.showPicker when clicked.
getShowPickerIcon in class FormItempublic void setSortField(String sortField)
field name or the index of the field in the fields Array. Note
that if sortField is initially specified as a number, it will be converted to a string (field name) after
the item is initialized.
sortField - . See String. Default value is nullpublic String getSortField()
field name or the index of the field in the fields Array. Note
that if sortField is initially specified as a number, it will be converted to a string (field name) after
the item is initialized.
Stringpublic void setSortField(Integer sortField)
field name or the index of the field in the fields Array. Note
that if sortField is initially specified as a number, it will be converted to a string (field name) after
the item is initialized.
sortField - sortField Default value is nullpublic void setTextBoxStyle(String textBoxStyle)
NOTE: See the CompoundFormItem_skinning discussion
for special skinning considerations.
setTextBoxStyle in class FormItemtextBoxStyle - . See FormItemBaseStyle. Default value is "selectItemText", [IRA]FormItem.setCellStyle(java.lang.String),
Appearance overview and related methodspublic String getTextBoxStyle()
NOTE: See the CompoundFormItem_skinning discussion
for special skinning considerations.
getTextBoxStyle in class FormItemFormItemBaseStyleFormItem.getCellStyle(),
Appearance overview and related methodspublic void setTextMatchStyle(TextMatchStyle textMatchStyle)
For a databound pickList (optionDataSource set),
textMatchStyle is sent to the server as textMatchStyle.
For a non-databound pickList, textMatchStyle is applied by filterClientPickListData.
setTextMatchStyle in interface PickListtextMatchStyle - textMatchStyle Default value is "startsWith"public TextMatchStyle getTextMatchStyle()
For a databound pickList (optionDataSource set),
textMatchStyle is sent to the server as textMatchStyle.
For a non-databound pickList, textMatchStyle is applied by filterClientPickListData.
getTextMatchStyle in interface PickListpublic void setValueField(String valueField)
displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name of this form item.
setValueField in interface PickListsetValueField in class FormItemvalueField - . See String. Default value is nullpublic String getValueField()
displayField values from an optionDataSource, this property denotes the the
field to use as the underlying data value in records from the optionDataSource.name of this form item.
getValueField in interface PickListgetValueField in class FormItemStringpublic HandlerRegistration addDataArrivedHandler(DataArrivedHandler handler)
If this item is showing a dataBound pickList, this notification method will be fired when new data arrives from the server.
addDataArrivedHandler in interface HasDataArrivedHandlershandler - the dataArrived handler
HandlerRegistration used to remove this handlerpublic void defaultDynamicValue()
defaultValue when no value is provided for this item. To default to the first option use defaultToFirstOption instead.
public String getDisplayFieldName()
displayField for this item. This will typically be specified explicitly via the displayField attribute. However, if that property is
unset, and the valueField for this item is
hidden in the optionDataSource, this method
will return the title field for the optionDataSource.
getDisplayFieldName in interface PickListgetDisplayFieldName in class FormItempublic String getValueFieldName()
valueField for this
item. If unset, default behavior will return the name
of this field.
getValueFieldName in interface PickListgetValueFieldName in class FormItemoptionDataSourceprotected Criteria getPickListFilterCriteria()
setPickListFilterCriteriaFunction(FormItemCriteriaFunction) to build custom criteria instead of overriding this method directly. This ensures that
the custom filter criteria generating code will be called even if the form item was automatically generated based on a template
passed to ListGridField.setEditorType(com.smartgwt.client.widgets.form.fields.FormItem).
public void setPickListFields(ListGridField... pickListFields)
Only applies to databound pickLists (see optionDataSource, or picklists with custom data set up via the advanced PickList.getClientPickListData() method.
If this property is unset, we display the displayField, if specified, otherwise the valueField
If there are multiple fields, column headers will be
shown for each field, the height of which can be customized via the pickListHeaderHeight attribute.
Each field to display should be specified as a
ListGridField object. Note that unlike in ListGrid, dataSource fields marked as com.smartgwt.client.data.DataSourceField#setDis${isc.DocUtils.linkForRef('DataSourceField.display','display:true')}
will not be hidden by default in pickLists. To override this behavior, ensure that you specify an explicit value
for {@link com.smartgwt.client.widgets.grid.ListGridField#getShowIf showIf}
Note : This is an advanced setting
pickListFields - pickListFields Default value is nullpublic void setPickListHeight(int pickListHeight)
setPickListHeight in interface PickListpickListHeight - pickListHeight Default value is 300public int getPickListHeight()
getPickListHeight in interface PickListpublic void setEmptyPickListHeight(int emptyPickListHeight)
hideEmptyPickList is false.
setEmptyPickListHeight in interface PickListemptyPickListHeight - emptyPickListHeight Default value is 100public int getEmptyPickListHeight()
hideEmptyPickList is false.
getEmptyPickListHeight in interface PickListpublic void setEmptyPickListMessage(String emptyPickListMessage)
hideEmptyPickList is false. Note : This is an advanced setting
setEmptyPickListMessage in interface PickListemptyPickListMessage - emptyPickListMessage Default value is nullpublic String getEmptyPickListMessage()
hideEmptyPickList is false.
getEmptyPickListMessage in interface PickListpublic void setHideEmptyPickList(Boolean hideEmptyPickList)
setHideEmptyPickList in interface PickListhideEmptyPickList - hideEmptyPickList Default value is nullpublic Boolean getHideEmptyPickList()
getHideEmptyPickList in interface PickListpublic void setPickListWidth(Integer pickListWidth)
setPickListWidth in interface PickListpickListWidth - pickListWidth Default value is nullpublic Integer getPickListWidth()
getPickListWidth in interface PickListpublic void setPickListBaseStyle(String pickListBaseStyle)
setPickListBaseStyle in interface PickListpickListBaseStyle - pickListBaseStyle Default value is "pickListCell"public String getPickListBaseStyle()
getPickListBaseStyle in interface PickListpublic void setAnimatePickList(Boolean animatePickList)
Note : This is an advanced setting
setAnimatePickList in interface PickListanimatePickList - animatePickList Default value is nullpublic Boolean getAnimatePickList()
getAnimatePickList in interface PickListpublic void setAnimationTime(int animationTime)
Note : This is an advanced setting
setAnimationTime in interface PickListanimationTime - animationTime Default value is 200public int getAnimationTime()
getAnimationTime in interface PickListpublic void setPickListHeaderHeight(int pickListHeaderHeight)
setPickListHeaderHeight in interface PickListpickListHeaderHeight - pickListHeaderHeight Default value is 22public int getPickListHeaderHeight()
getPickListHeaderHeight in interface PickListpublic Integer getSortFieldAsInt()
'field name' or the index of the field in the fields Array.
Note that if sortField is initally specified as a number, it will be converted to a string (field name)
after the item is initialized. To programmatically change sort field or direction after initialization, call ${isc.DocUtils.linkForRef('sort')}.
public void setValueIconField(String valueIconField)
valueIcons should show up in for this formItem's pickList.displayField column if specified, otherwise
the valueField column.displayField or valueField will be visible. This property is typically only
required if custom pickListFields
have been specfied for this item. Note : This is an advanced setting
setValueIconField in interface PickListvalueIconField - valueIconField Default value is nullpublic String getValueIconField()
valueIcons should show up in for this formItem's pickList.displayField column if specified, otherwise
the valueField column.displayField or valueField will be visible. This property is typically only
required if custom pickListFields
have been specfied for this item.
getValueIconField in interface PickListpublic void setShowAllOptions(Boolean showAllOptions)
separatorRows in between. Not valid for optionDataSource.
setShowAllOptions in interface PickListshowAllOptions - showAllOptions Default value is nullpublic Boolean getShowAllOptions()
separatorRows in between. Not valid for optionDataSource.
getShowAllOptions in interface PickListpublic void setPickListCriteria(DSRequest optionFilterContext)
optionDataSource, and this property is not null, this will be passed to
the datasource as RPCRequest properties when performing the filter operation on
the dataSource to obtain the set of options for the list. Note : This is an advanced setting
optionFilterContext - optionFilterContext Default value is nullpublic void setOptionDataSource(DataSource dataSource)
optionDataSource. The fetched data will be used as a valueMap by extracting the valueField and
displayField in the loaded records, to
derive one valueMap entry per record loaded from the optionDataSource. Multiple fields from the fetched data may
be shown in the pickList by setting pickListFields. The data will be retrieved via a "fetch" operation on the DataSource, passing the pickListCriteria (if set) as criteria, and passing optionFilterContext (if set) as
DSRequest properties.
The fetch will be triggered when the pickList is first shown, or, you can set autoFetchData to fetch when the FormItem is
first drawn. You can also call com.smartgwt.client.widgets.form.fields.PickList#fetchData at any time to manually trigger
a fetch.
Data paging is automatically enabled if the optionDataSource supports it. As the pickList is scrolled by the user, requests for additional data will be automatically issued.
For a pickList attached to a
ComboBoxItem, new fetches are issued as the user types, with criteria set as described under ComboBoxItem.getPickListFilterCriteria(). If your dataSource is not
capable of filtering results by search criteria (eg the dataSource is backed by an XML flat file), you can set
filterLocally to have the entire
dataset loaded up front and filtering performed in the browser. This disables data paging.
Setting
optionDataSource also enables the basic optionDataSource behaviors, eg, fetching individual display values before the pickList is shown.
Note that
if a normal, static valueMap is also
specified for the field (either directly in the form item or as part of the field definition in the dataSource),
it will be preferred to the data derived from the optionDataSource for whatever mappings are present.
Note : This is an advanced setting
setOptionDataSource in interface PickListsetOptionDataSource in class FormItemoptionDataSource - optionDataSource Default value is nullpublic DataSource getOptionDataSource()
getOptionDataSource in interface PickListpublic void setSeparatorRows(ListGridRecord[] separatorRows)
PickList
Not valid for 'databound pickLists'.
setSeparatorRows in interface PickListseparatorRows - separator rowspublic void setDefaultValues(String... defaultValues)
null programatically, it will be reverted to the defaultValues.
defaultValues - the defaultValues. Default value is nullpublic void setDefaultValues(Integer... defaultValues)
null programatically, it will be reverted to the defaultValues.
defaultValues - the defaultValues. Default value is nullpublic void setFetchDelay(Integer fetchDelay)
PickList
setFetchDelay in interface PickListfetchDelay - the fetch delay. defaults to 200mspublic Integer getFetchDelay()
PickList
getFetchDelay in interface PickListpublic String[] getValues()
public void setValues(String... values)
values - the SelectItem valuespublic Boolean isMultiple()
The SelectItem will either render as a drop-down allowing multiple
selections, or a multi-row list of options similar to a small headerless ListGrid, based on the MultipleAppearance setting.
The logical value of the formItem, as retrieved by getValue() and set via setValue(), is an Array of
Strings reflecting the selected values.
When this value is true, we disable doubleClick events by default, instead
issuing two single clicks by forcibly setting noDoubleClicks: true. If you need to work with doubleClick events, you can disable this default behavior by explicitly
setting formItem.pickListProperties.noDoubleClicks: false.
Note: multiple:true SelectItems do not
currently support optionDataSource binding. You can get around this by calling DataSource.fetchData directly and calling dsResponse.data.getValueMap() to obtain a valueMap.
Appearance overview and related methodspublic void fetchData()
optionDataSource).pickListCriteria.
public void fetchData(DSCallback callback)
optionDataSource).pickListCriteria.
callback - Callback to fire when the fetch completes. Callback will fire with 2 parameters:
item a pointer to the form item and dsResponse the DSResponse returned by the server.
public void fetchData(DSCallback callback,
DSRequest requestProperties)
optionDataSource).pickListCriteria.
callback - Callback to fire when the fetch completes. Callback will fire with 2
parameters: item a pointer to the form item and
dsResponse the DSResponse returned by the
server.requestProperties - properties to apply to the dsRequest for this fetch.public ListGridRecord[] filterClientPickListData()
PickList
The default implementation applies the criteria returned by #getPickListFilterCriteria to the data returned
by PickList.getClientPickListData(). A record passes the filter if it has a matching value for all fields in the criteria
object. Matching is performed according to textMatchStyle.
If showAllOptions is set, all values are shown, with matching values shown below a
separator.
filterClientPickListData in interface PickListpublic ListGridRecord[] getClientPickListData()
PickListThis method will be called for non-databound form items implementing the PickList interface. The default implementation will derive data from the item's valueMap - can be overridden to allow a custom set of options to be displayed.
Note that for PickLists that filter data based on user input 'ComboBox'), this method should
return the data before filtering.
getClientPickListData in interface PickListpublic void setFields(FormItemIcon pickerIconProperties)
public void showPicker()
this.showPickerIcon to true. May also be called programatically.
showPicker in class FormItempublic ListGridRecord getSelectedRecord()
getSelectedRecord in class FormItempublic ListGridRecord[] getSelectedRecords()
setOptionDataSource(com.smartgwt.client.data.DataSource) optionDataSource} and allowing multiple
selection multiple :true, returns the list of currently selected records, or null if none are selected.
public void setPickListFilterCriteriaFunction(FilterCriteriaFunction filterCriteriaFunction)
setPickListFilterCriteriaFunction(FormItemCriteriaFunction)
setPickListFilterCriteriaFunction in interface PickListfilterCriteriaFunction - the filter criteria functionpublic void setPickListFilterCriteriaFunction(FormItemCriteriaFunction filterCriteriaFunction)
public void setPickListProperties(ListGrid pickListProperties)
pickListProperties - the pick list propertiespublic void setOptionFilterContext(DSRequest dsRequestProperties)
PickListoptionDataSource, and this property is
not null, this will be passed to the datasource as RPCRequest properties when
performing the fetch operation on the dataSource to obtain a data-value to display-value
mapping
Note : This is an advanced setting
setOptionFilterContext in interface PickListdsRequestProperties - optionFilterContext Default value is nullpublic String getValueAsString()
public void setPickListSort(SortSpecifier[] sortSpecifiers)
'unused fields from the underlying dataSource',
if there is one. If multiple fields are sorted, those that are visible show a directional icon and a small
'sort-numeral' indicating that
field's index in the sort configuration.
See ListGrid.addSort(com.smartgwt.client.data.SortSpecifier)
and com.smartgwt.client.widgets.grid.ListGrid#alterSort
APIs for information on making changes to the current sort configuration.
sortSpecifiers - Array of SortSpecifier objects
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||