Class ComboBoxItem
- All Implemented Interfaces:
HasHandlers
,HasBlurHandlers
,HasChangedHandlers
,HasChangeHandlers
,HasClickHandlers
,HasDataArrivedHandlers
,HasDoubleClickHandlers
,HasEditorEnterHandlers
,HasEditorExitHandlers
,HasFocusHandlers
,HasIconClickHandlers
,HasIconKeyPressHandlers
,HasItemHoverHandlers
,HasKeyDownHandlers
,HasKeyPressHandlers
,HasKeyUpHandlers
,HasPendingStatusChangedHandlers
,HasPickerIconClickHandlers
,HasShowContextMenuHandlers
,HasTitleClickHandlers
,HasTitleDoubleClickHandlers
,HasTitleHoverHandlers
,HasValueHoverHandlers
,HasValueIconClickHandlers
,PickList
The set of options will be filtered based on the current value in the text field, so only options that match what has been typed so far will be displayed. The set of options can be derived from a ValueMap or dynamically retrieved from a dataSource. See the PickList interface for further settings.
The two most common use cases for ComboBoxItems are:
- With
addUnknownValues
set to true, the ComboBoxItem acts as a freeform text entry field with the picklist providing essentially a set of suggested completions similar to a URL bar in a web browser. - With
addUnknownValues
set to false, the ComboBoxItem acts similarly to a SelectItem where a fixed set of options is available to the user and the text entry field is essentially used to filter which of these options are visible
Other commonly used settings to
configure ComboBoxItem behavior are:
- defaultToFirstOption
- this will select
the first option from the pickList as a default value for the item - and
- completeOnTab
which causes the current selection
in the pickList (if there is one) to be chosen when the user tabs out of the field, allowing a user to type a few
characters and hit tab to auto-complete to the first matched option. completeOnTab
is automatically set to
true if addUnknownValues
is false.
ComboBoxItem does not provide built-in support for multiple selection. For a Combobox that does provide such a
multiple-select feature use MultiComboBoxItem
.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.smartgwt.client.widgets.form.fields.FormItem
FormItem.CustomStateGetter, FormItem.StateCustomizer
-
Field Summary
Fields inherited from class com.smartgwt.client.widgets.form.fields.FormItem
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefault
Fields inherited from class com.smartgwt.client.core.RefDataClass
id
Fields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties
-
Constructor Summary
ConstructorDescriptionComboBoxItem
(JavaScriptObject jsObj) ComboBoxItem
(String name) ComboBoxItem
(String name, String title) -
Method Summary
Modifier and TypeMethodDescriptionaddDataArrivedHandler
(DataArrivedHandler handler) Add a dataArrived handler.static void
changeAutoChildDefaults
(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName
.static void
changeAutoChildDefaults
(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName
.static void
changePickerIconDefaults
(FormItemIcon defaults) defaultDynamicValue
(FormItem item, DynamicForm form, Map values) Expression evaluated to determine thedefaultValue
when no value is provided for this item.void
Only applies to databound items (see PickList.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 PickList.pickListCriteria.void
fetchData
(DSCallback callback) void
fetchData
(DSCallback callback, DSRequest requestProperties) Only applies to databound items (see PickList.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 PickList.pickListCriteria.Returns the data to display in the pick list.This property controls whether the user can enter a value that is not present in the set of options for this item.IfaddUnknownValues
isfalse
, this property determines whether the user can clear the comboBoxItem value, or whether they are constrained to choosing one of the available options (in which case clearing the text box will simply revert to the last picked value when the user leaves the field).The standardFormItem.allowExpressions
behavior is always disabled for ComboBoxItem.If true, when the pickList is shown, it will be shown via an animated reveal effectint
If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickListIf this combo box retrieves its options from adataSource
, should options be fetched from the server when the item is first written out, or should this fetch be delayed until the user opens the pickList.When this item is showing a tree-based picker, which nodes should be opened automatically.boolean
For databound pickLists (see PickList.optionDataSource), by default Smart GWT will cache and re-use datasets shown by different pickLists displayed by different SelectItems in an LRU (least recently used) caching pattern.Returns the set of data to be displayed in this item's PickList.If true, when the pickList is showing, the user can select the current value by hitting theEnter
key.If true, when the pickList is showing, the user can select the current value by hitting theTab
key.Whether to show the picker as a flat list, or a collapsible tree.Select the first option as the default value for this ComboBoxItem.Static default value for this ComboBoxItem.If set, this item will display a value from another field to the user instead of showing the underlying data value for thefield name
.Returns thedisplayField
for this item.Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.int
Height for an empty pick list (showing the empty message), if the pick list has no records andhideEmptyPickList
isfalse
.Empty message to display in the comboboxItem if PickList.hideEmptyPickList isfalse
.Returns the raw text value that currently appears in the text field, which can differ fromFormItem.getValue()
in various cases - for example: for items that constrain the value range, such as aDateItem
withenforceDate
:true, or aComboBoxItem
withaddUnknownValues
:false for items with a defined valueMap or edit value formatter and parser functions which converts display value to data value while the item has focus ifchangeOnKeypress
is false Note: if the pickList is being shown in any view other than the defaultnearOrigin
, as is typically the case on a mobile device, this method will return the value of thepickerSearchField
.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.If this item has a specifiedoptionDataSource
and this property istrue
, the list of fields used by this pickList will be passed to the datasource asDSRequest.outputs
.String[]
As the user types into this item's textBox, a comboBoxItem will show the pick-list of options, and filter the set of results displayed by the current value in the text box.IffilterLocally
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.boolean
Read-only property set by the ComboBoxItem to indicate whether we should use the current typed-in value as part of the filter criteria returned bygetPickListFilterCriteria()
.WithformatOnBlur
enabled, this comboBoxItem will format its value according to the rules described inFormItem.mapValueToDisplay()
as long as the item does not have focus.When a comboBoxItem is used to generate search criteria in a SearchForm this property governs whether, if the user explicitly chose an option from the pickList, we explicitly generate criteria that will search for an exact match against the chosen value.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.For PickList items withPickListItemIconPlacement
set such that the pickList does not render near-origin, should specifiedicons
be rendered inline within the formItem itself, or within thepickerNavigationBar
.An array ofSortSpecifier
objects used to set up the initial sort configuration for this pickList.getMask()
Not applicable to a ComboBoxItem.Not applicable to a ComboBoxItem.Not applicable to a ComboBoxItem.Not applicable to a ComboBoxItem.Not applicable to a ComboBoxItem.Minimum length in characters before a search is performed.If set, this FormItem will map stored values to display values as though acom.smartgwt.client.types.ValueMap
were specified, by fetching records from the specifiedoptionDataSource
and extracting thevalueField
anddisplayField
in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.If this item has a specifiedoptionDataSource
, this attribute may be set to specify an explicitDSRequest.operationId
when performing a fetch against the option dataSource to pick up display value mapping.static ComboBoxItem
getOrCreateRef
(JavaScriptObject jsObj) Optional "pending" style for this item's text box.NavigationButton
to clear the picker value, created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen.The title for thepickerClearButton
.NavigationButton
to dismiss the picker interface, created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen.The title for thepickerExitButton
.Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item.IfshowPickerIcon
is true for this item, this property governs thesrc
of the picker icon image to be displayed.NavigationBar
created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen."Accept" button foraddUnknownValues:true
ComboBoxItems showing the mobile interface.The title for thepickerSaveButton
.ThepickerSearchField
is a separateTextItem
created for search string entry whenpickListPlacement
indicates that the search interface takes over an entire panel or the entire screen.FormItem.hint
for thepickerSearchField
.Form that contains thepickerSearchField
.FormItemIcon displayed in thepickerSearchField
whenshowPickerSearchIcon
is true.Size for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.Source for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.ListGrid-based AutoChild created by the system to display a list of pickable options for this item.Base Style for pickList cells.int
Cell Height for this item's pickList.The Class to use when creating a picker of type "list" for a FormItem.If this item has a databound pickList (for example PickList.optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList.protected Criteria
Returns filter criteria for options displayed for this item.int
If this pick list is showing multiple fields, this property determines the height of the column headers for those fields.int
Maximum height to show the pick list before it starts to scroll.Maximum width for this item's pickList.Controls where the PickList is placed.Controls where the PickList is placed.Controls where the PickList is placed.Default width to show the pickList.The Class to use when creating a picker of type "tree" for a FormItem.Indicates whether or not this ComboBoxItem will load its list of optionsprogressively
.ComboBox items will submit their containing form on enter keypress ifsaveOnEnter
is true.Message to display in pick list whenminimumSearchLength
characters have not been entered.Returns the entire record object associated with the current value for this item (or null if no matching record exists in the PickList data).If true,specialValues
special values such as the empty value will be shown in a separate non-scrolling area, in theseparateValuesList
.AutoChild used to showspecialValues
.If true, even non-matching options will be shown, with configurableseparator rows
in between.If showing a hint for this form item, should it be shown within the field?If this item is part of a databound form, and has a specifiedvalueMap
, by default we show the valueMap options in the pickList for the item.Should we show a special 'picker'icon
for this form item? Picker icons are customizable viapickerIconProperties
.When set to true, shows anicon
in thepickerSearchField
of a full-screen picker.Should the list of options be displayed whenever the user types into the combo-box textArea, or only when the user clicks on the pick button or uses the explicitAlt+Arrow Down
key combination?boolean
When this item is showing a tree-based picker, the default behavior is for folder open-state to be toggled by double-clicking.Specifies one or more fields by which this item should be initially sorted.Specifies one or more fields by which this item should be initially sorted.String[]
Specifies one or more fields by which this item should be initially sorted.When applying filter criteria to pickList data, what type of matching to use.Fordatabound
items, this property will be passed to the generated ResultSet data object for the pickList asResultSet.useClientFiltering
.Return the value tracked by this form item.If this form item maps data values to display values by retrieving theFormItem.displayField
values from anoptionDataSource
, this property denotes the the field to use as the underlying data value in records from the optionDataSource.
If not explicitly supplied, the valueField name will be derived as described inFormItem.getValueFieldName()
.Getter method to retrieve theFormItem.valueField
for this item.For Databound formItems, this property determines which columnvalueIcons
should show up in for this formItem's pickList.
If unset valueIcons show up in thedisplayField
column if specified, otherwise thevalueField
column.
In most cases only thedisplayField
orvalueField
will be visible.Will this item return advancedCriteria ifDynamicForm.getValuesAsCriteria()
is called on this item's form?setAddUnknownValues
(Boolean addUnknownValues) This property controls whether the user can enter a value that is not present in the set of options for this item.setAllowEmptyValue
(Boolean allowEmptyValue) IfaddUnknownValues
isfalse
, this property determines whether the user can clear the comboBoxItem value, or whether they are constrained to choosing one of the available options (in which case clearing the text box will simply revert to the last picked value when the user leaves the field).setAllowExpressions
(Boolean allowExpressions) The standardFormItem.allowExpressions
behavior is always disabled for ComboBoxItem.void
setAnimatePickList
(Boolean animatePickList) If true, when the pickList is shown, it will be shown via an animated reveal effectvoid
setAnimationTime
(int animationTime) If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickListsetAutoFetchData
(Boolean autoFetchData) If this combo box retrieves its options from adataSource
, should options be fetched from the server when the item is first written out, or should this fetch be delayed until the user opens the pickList.setAutoOpenTree
(String autoOpenTree) When this item is showing a tree-based picker, which nodes should be opened automatically.setCachePickListResults
(boolean cachePickListResults) For databound pickLists (see PickList.optionDataSource), by default Smart GWT will cache and re-use datasets shown by different pickLists displayed by different SelectItems in an LRU (least recently used) caching pattern.void
The defaultcanEditCriterion()
predicate is overridden in comboBoxItem.setCompleteOnEnter
(Boolean completeOnEnter) If true, when the pickList is showing, the user can select the current value by hitting theEnter
key.setCompleteOnTab
(Boolean completeOnTab) If true, when the pickList is showing, the user can select the current value by hitting theTab
key.void
The defaultgetCriterion()
implementation returns criterion derived from the current value of this item.void
The defaultsetCriterion()
implementation is overridden to support editing criterion against the display field or value field whenaddUnknownValues
is true.setDataSetType
(String dataSetType) Whether to show the picker as a flat list, or a collapsible tree.static void
setDefaultProperties
(ComboBoxItem comboBoxItemProperties) Class level method to set the default properties of this class.setDefaultToFirstOption
(Boolean defaultToFirstOption) Select the first option as the default value for this ComboBoxItem.setDisplayField
(String displayField) If set, this item will display a value from another field to the user instead of showing the underlying data value for thefield name
.setEditProxyConstructor
(String editProxyConstructor) Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.void
setEmptyPickListHeight
(int emptyPickListHeight) Height for an empty pick list (showing the empty message), if the pick list has no records andhideEmptyPickList
isfalse
.setEmptyPickListMessage
(String emptyPickListMessage) Empty message to display in the comboboxItem if PickList.hideEmptyPickList isfalse
.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.setFetchDisplayedFieldsOnly
(Boolean fetchDisplayedFieldsOnly) If this item has a specifiedoptionDataSource
and this property istrue
, the list of fields used by this pickList will be passed to the datasource asDSRequest.outputs
.setFilterFields
(String... filterFields) As the user types into this item's textBox, a comboBoxItem will show the pick-list of options, and filter the set of results displayed by the current value in the text box.setFilterLocally
(Boolean filterLocally) IffilterLocally
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.setFormatOnBlur
(Boolean formatOnBlur) WithformatOnBlur
enabled, this comboBoxItem will format its value according to the rules described inFormItem.mapValueToDisplay()
as long as the item does not have focus.setGenerateExactMatchCriteria
(Boolean generateExactMatchCriteria) When a comboBoxItem is used to generate search criteria in a SearchForm this property governs whether, if the user explicitly chose an option from the pickList, we explicitly generate criteria that will search for an exact match against the chosen value.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.setIconPlacement
(PickListItemIconPlacement iconPlacement) For PickList items withPickListItemIconPlacement
set such that the pickList does not render near-origin, should specifiedicons
be rendered inline within the formItem itself, or within thepickerNavigationBar
.setInitialSort
(SortSpecifier... initialSort) An array ofSortSpecifier
objects used to set up the initial sort configuration for this pickList.Not applicable to a ComboBoxItem.setMaskOverwriteMode
(Boolean maskOverwriteMode) Not applicable to a ComboBoxItem.setMaskPadChar
(String maskPadChar) Not applicable to a ComboBoxItem.setMaskPromptChar
(String maskPromptChar) Not applicable to a ComboBoxItem.setMaskSaveLiterals
(Boolean maskSaveLiterals) Not applicable to a ComboBoxItem.setMinimumSearchLength
(Integer minimumSearchLength) Minimum length in characters before a search is performed.setOptionDataSource
(DataSource dataSource) If set, this FormItem will derive data to show in the PickList by fetching records from the specifiedoptionDataSource
.void
setOptionFilterContext
(DSRequest dsRequestProperties) If this item has a specifiedoptionDataSource
, and this property is
 not null, this will be passed to the datasource asRPCRequest
properties when
 performing the fetch operation on the dataSource to obtain a data-value to display-value
 mappingsetOptionOperationId
(String optionOperationId) If this item has a specifiedoptionDataSource
, this attribute may be set to specify an explicitDSRequest.operationId
when performing a fetch against the option dataSource to pick up display value mapping.setPendingTextBoxStyle
(String pendingTextBoxStyle) Optional "pending" style for this item's text box.setPickerClearButtonTitle
(String pickerClearButtonTitle) The title for thepickerClearButton
.setPickerExitButtonTitle
(String pickerExitButtonTitle) The title for thepickerExitButton
.setPickerIconHeight
(Integer pickerIconHeight) Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item.setPickerIconSrc
(String pickerIconSrc) IfshowPickerIcon
is true for this item, this property governs thesrc
of the picker icon image to be displayed.setPickerSaveButtonTitle
(String pickerSaveButtonTitle) The title for thepickerSaveButton
.setPickerSearchFieldHint
(String pickerSearchFieldHint) FormItem.hint
for thepickerSearchField
.setPickerSearchIconSize
(Integer pickerSearchIconSize) Size for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.setPickerSearchIconSrc
(String pickerSearchIconSrc) Source for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.setPickerSearchOrNewValueFieldHint
(String pickerSearchOrNewValueFieldHint) void
setPickListBaseStyle
(String pickListBaseStyle) Base Style for pickList cells.void
setPickListCellHeight
(int pickListCellHeight) Cell Height for this item's pickList.setPickListConstructor
(String pickListConstructor) The Class to use when creating a picker of type "list" for a FormItem.setPickListCriteria
(Criteria pickListCriteria) If this item has a databound pickList (for example PickList.optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList.void
setPickListCriteria
(DSRequest optionFilterContext) 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.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
setPickListMaxWidth
(Integer pickListMaxWidth) Maximum width for this item's pickList.setPickListPlacement
(PanelPlacement pickListPlacement) Controls where the PickList is placed.setPickListPlacement
(Canvas pickListPlacement) Controls where the PickList is placed.setPickListPlacement
(String pickListPlacement) Controls where the PickList is placed.void
setPickListProperties
(ListGrid pickListProperties) Allows developers to designate aPickListMenu
as a template containing arbitrary properties to apply to the pickList that will be created for this FormItem.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.setPickTreeConstructor
(String pickTreeConstructor) The Class to use when creating a picker of type "tree" for a FormItem.setProgressiveLoading
(Boolean progressiveLoading) Indicates whether or not this ComboBoxItem will load its list of optionsprogressively
.setRootNodeId
(Integer rootNodeId) setRootNodeId
(String rootNodeId) setSaveOnEnter
(Boolean saveOnEnter) ComboBox items will submit their containing form on enter keypress ifsaveOnEnter
is true.setSearchStringTooShortMessage
(String searchStringTooShortMessage) Message to display in pick list whenminimumSearchLength
characters have not been entered.setSeparateSpecialValues
(Boolean separateSpecialValues) If true,specialValues
special values such as the empty value will be shown in a separate non-scrolling area, in theseparateValuesList
.setSeparatorRows
(ListGridRecord[] separatorRows) Array of records to show between matching and non-matching rows in the PickList.setShowAllOptions
(Boolean showAllOptions) If true, even non-matching options will be shown, with configurableseparator rows
in between.setShowHintInField
(Boolean showHintInField) If showing a hint for this form item, should it be shown within the field?setShowOptionsFromDataSource
(Boolean showOptionsFromDataSource) If this item is part of a databound form, and has a specifiedvalueMap
, by default we show the valueMap options in the pickList for the item.setShowPickerIcon
(Boolean showPickerIcon) Should we show a special 'picker'icon
for this form item? Picker icons are customizable viapickerIconProperties
.setShowPickerSearchIcon
(Boolean showPickerSearchIcon) When set to true, shows anicon
in thepickerSearchField
of a full-screen picker.setShowPickListOnKeypress
(Boolean showPickListOnKeypress) Should the list of options be displayed whenever the user types into the combo-box textArea, or only when the user clicks on the pick button or uses the explicitAlt+Arrow Down
key combination?setSingleClickFolderToggle
(boolean singleClickFolderToggle) When this item is showing a tree-based picker, the default behavior is for folder open-state to be toggled by double-clicking.void
setSort
(SortSpecifier[] sortSpecifiers) Deprecated.in favor ofsetPickListSort(SortSpecifier[])
where full documentation can be read.setSortField
(Integer sortField) Specifies one or more fields by which this item should be initially sorted.setSortField
(String sortField) Specifies one or more fields by which this item should be initially sorted.setSortField
(String... sortField) Specifies one or more fields by which this item should be initially sorted.void
setSpecialValues
(String... values) Set the specialValues for this item.void
setSpecialValues
(LinkedHashMap valueMap) Set the specialValues for this item.setTextMatchStyle
(TextMatchStyle textMatchStyle) When applying filter criteria to pickList data, what type of matching to use.setUseClientFiltering
(Boolean useClientFiltering) Fordatabound
items, this property will be passed to the generated ResultSet data object for the pickList asResultSet.useClientFiltering
.setValueField
(String valueField) If this form item maps data values to display values by retrieving theFormItem.displayField
values from anoptionDataSource
, this property denotes the the field to use as the underlying data value in records from the optionDataSource.
If not explicitly supplied, the valueField name will be derived as described inFormItem.getValueFieldName()
.void
setValueIconField
(String valueIconField) For Databound formItems, this property determines which columnvalueIcons
should show up in for this formItem's pickList.
If unset valueIcons show up in thedisplayField
column if specified, otherwise thevalueField
column.
In most cases only thedisplayField
orvalueField
will be visible.When a comboBoxItem is used to generate search criteria in a SearchForm, if the user explicitly chose an option from the pickList, should the criterion generated by theFormItemCriterionGetter
'sgetCriterion()
method enforce a search for an exact match against the chosen value?Methods inherited from class com.smartgwt.client.widgets.form.fields.TextItem
deselectValue, deselectValue, getBrowserAutoCapitalize, getBrowserAutoCorrect, getBrowserInputType, getChangeOnKeypress, getCharacterCasing, getEnforceLength, getEscapeHTML, getFetchMissingValues, getFormatOnFocusChange, getHint, getKeyPressFilter, getLength, getPrintFullText, getSelectionRange, getSelectOnClick, getSelectOnFocus, getShowInputElement, getSupportsCutPasteEvents, getSuppressBrowserClearIcon, getTextBoxStyle, getUsePlaceholderForHint, pendingStatusChanged, selectValue, setBrowserAutoCapitalize, setBrowserAutoCorrect, setBrowserInputType, setChangeOnKeypress, setCharacterCasing, setDefaultProperties, setEnforceLength, setEscapeHTML, setFetchMissingValues, setFormatOnFocusChange, setKeyPressFilter, setLength, setPastedValueTransformer, setPrintFullText, setSelectionRange, setSelectOnClick, setSelectOnFocus, setShowInputElement, setSupportsCutPasteEvents, setSuppressBrowserClearIcon, setTextBoxStyle, setUsePlaceholderForHint, shouldFetchMissingValue
Methods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIcon, addIcon, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, checkFormItemType, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusAfterItem, focusInItem, getAccessKey, getAlign, getAlwaysFetchMissingValues, getAlwaysShowControlBox, getApplyAlignToText, getApplyHeightToTextBox, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getAutoCompleteKeywords, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanHover, getCanSelectText, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getControlStyle, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDefaultOperator, getDestroyed, getDisabled, getDisabledHover, getDisableIconsOnReadOnly, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconProperties, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getExportFormat, getFieldName, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHeight, getHeightAsString, getHidden, getHintStyle, getHoverAlign, getHoverDelay, getHoverFocusKey, getHoverHeight, getHoverHeightAsString, getHoverOpacity, getHoverPersist, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWidthAsString, getIcon, getIconBaseStyle, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIcons, getIconTabPosition, getIconVAlign, getIconWidth, getID, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLinearColSpan, getLinearColSpanAsString, getLinearEndRow, getLinearEndRowAsString, getLinearStartRow, getLinearStartRowAsString, getLinearWidth, getLinearWidthAsString, getListGrid, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultiple, getMultipleValueSeparator, getName, getNullOriginalValueText, getOperator, getOptionCriteria, getOptionDataSourceAsString, getOptionFilterContext, getOptionTextMatchStyle, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPaletteDefaults, getPicker, getPickerIcon, getPickerIcon, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconStyle, getPickerIconTabPosition, getPickerIconWidth, getPixelHeight, getPixelWidth, getPrintReadOnlyTextBoxStyle, getPrintTextBoxStyle, getPrintTitleStyle, getPrompt, getReadOnlyCanSelectText, getReadOnlyControlStyle, getReadOnlyDisplay, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredWhen, getRowSpan, getScClassName, getShouldSaveValue, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowDisabledIconsOnFocus, getShowDisabledPickerIconOnFocus, getShowErrorIcon, getShowErrorIconInline, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowIconsOnFocus, getShowImageAsURL, getShowOldValueInHover, getShowOver, getShowOverIcons, getShowPending, getShowPickerIconOnFocus, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getStoreDisplayValues, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextFormula, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitleStyle, getTitleVAlign, getTooltip, getTop, getType, getUpdateControlOnOver, getUpdatePickerIconOnOver, getUpdateTextBoxOnOver, getUseAdvancedCriteria, getUseDisabledHintStyleForReadOnly, getUseLocalDisplayFieldValue, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsRecordList, getValueDeselectedCSSText, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getValueMap, getValueMapAsArray, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapHintText, getWrapStaticValue, getWrapTitle, handleWarnOnEditorTypeConversion, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isAssignableFrom, isConfigOnly, isCreated, isCutEvent, isDisabled, isDrawn, isFocused, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, removeIcon, selectedRecordChanged, setAccessKey, setAlign, setAlwaysFetchMissingValues, setAlwaysShowControlBox, setApplyAlignToText, setApplyHeightToTextBox, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setAutoCompleteKeywords, setBrowserSpellCheck, setCanEdit, setCanEditOpaqueValues, setCanFocus, setCanHover, setCanSelectText, setCanTabToIcons, setCellHeight, setCellStyle, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setConfigOnly, setControlStyle, setCriteriaField, setCriterion, setCustomStateGetter, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultOperator, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDisabled, setDisabledHover, setDisableIconsOnReadOnly, setDisplayFormat, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconProperties, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setExportFormat, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHeight, setHeight, setHidden, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverFocusKey, setHoverHeight, setHoverHeight, setHoverOpacity, setHoverPersist, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWidth, setIconBaseStyle, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconShowOnFocus, setIconVAlign, setIconWidth, setID, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLinearColSpan, setLinearColSpan, setLinearEndRow, setLinearEndRow, setLinearStartRow, setLinearStartRow, setLinearWidth, setLinearWidth, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultiple, setMultipleValueSeparator, setName, setNullOriginalValueText, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionFilterContext, setOptionTextMatchStyle, setOriginalValueMessage, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconStyle, setPickerIconWidth, setPrintReadOnlyTextBoxStyle, setPrintTextBoxStyle, setPrintTitleStyle, setPrompt, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyCanSelectText, setReadOnlyControlStyle, setReadOnlyDisplay, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredWhen, setRowSpan, setScClassName, setShouldSaveValue, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowDisabledIconsOnFocus, setShowDisabledPickerIconOnFocus, setShowErrorIcon, setShowErrorIconInline, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIconsOnFocus, setShowIfCondition, setShowImageAsURL, setShowOldValueInHover, setShowOver, setShowOverIcons, setShowPending, setShowPickerIconOnFocus, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setStoreDisplayValues, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextFormula, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitleStyle, setTitleVAlign, setTooltip, setTop, setType, setUpdateControlOnOver, setUpdatePickerIconOnOver, setUpdateTextBoxOnOver, setUseAdvancedCriteria, setUseDisabledHintStyleForReadOnly, setUseLocalDisplayFieldValue, setUseObjectFactoryForTypeFallback, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueDeselectedCSSText, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapHintText, setWrapStaticValue, setWrapTitle, shouldApplyHeightToTextBox, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, showPicker, stopHover, storeValue, storeValue, updateState, validate, valueClipped
Methods inherited from class com.smartgwt.client.data.Field
getCanExport, getExportTitle, getSortByField, setCanExport, setExportTitle, setSortByField
Methods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetID
Methods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreated
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
ComboBoxItem
public ComboBoxItem() -
ComboBoxItem
-
ComboBoxItem
-
ComboBoxItem
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName
.- Parameters:
autoChildName
- name of an AutoChild to customize the defaults for.defaults
- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties
.- See Also:
-
changePickerIconDefaults
-
setAddUnknownValues
This property controls whether the user can enter a value that is not present in the set of options for this item.If set to false, the value the user enters in the text box is essentially used to filter the set of options displayed in the pickList.
In this mode, when focus is taken from the field, if the entered value does not match any entries in the
com.smartgwt.client.types.ValueMap
oroptionDataSource
, it will be discarded. Note that in this mode,completeOnTab
behavior is automatically enabled so if the user enters a valid partial value such that one or more options is displayed in the pickList, and hits the Tab key, the first matching option will be chosen automatically. In this mode the user may also hit the"Escape"
key to discard their edits.Note also that when
addUnknownValues
is set to false, the underlying value returned bygetValue()
will not be updated until a value is explicitly chosen. This means any change or changed handlers will not fire directly in response to the user typing in the field - they will fire when the user actually selects a value, or takes focus from the field.If this property is set to true, the user is not limited to entering values present in the set of options for the item. Instead the set of options essentially become a set of suggestions that may be used, or the user can enter an entirely new value.
- Parameters:
addUnknownValues
- New addUnknownValues value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getAddUnknownValues
This property controls whether the user can enter a value that is not present in the set of options for this item.If set to false, the value the user enters in the text box is essentially used to filter the set of options displayed in the pickList.
In this mode, when focus is taken from the field, if the entered value does not match any entries in the
com.smartgwt.client.types.ValueMap
oroptionDataSource
, it will be discarded. Note that in this mode,completeOnTab
behavior is automatically enabled so if the user enters a valid partial value such that one or more options is displayed in the pickList, and hits the Tab key, the first matching option will be chosen automatically. In this mode the user may also hit the"Escape"
key to discard their edits.Note also that when
addUnknownValues
is set to false, the underlying value returned bygetValue()
will not be updated until a value is explicitly chosen. This means any change or changed handlers will not fire directly in response to the user typing in the field - they will fire when the user actually selects a value, or takes focus from the field.If this property is set to true, the user is not limited to entering values present in the set of options for the item. Instead the set of options essentially become a set of suggestions that may be used, or the user can enter an entirely new value.
- Returns:
- Current addUnknownValues value. Default value is true
-
setAllowEmptyValue
IfaddUnknownValues
isfalse
, this property determines whether the user can clear the comboBoxItem value, or whether they are constrained to choosing one of the available options (in which case clearing the text box will simply revert to the last picked value when the user leaves the field). Note that a blank pickList line will never be shown regardless of this property's value, unlike for aSelectItem
, where it may depending uponallowEmptyValue
andmultiple
.See also
specialValues
as a way of providing several different special values in addition to an empty value, such as "Invalid". Note that settingspecialValues
disables the use ofallowEmptyValue
- see details of how to have an empty value while usingspecialValues
in inthe
.specialValues
documentation- Parameters:
allowEmptyValue
- New allowEmptyValue value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getAllowEmptyValue
IfaddUnknownValues
isfalse
, this property determines whether the user can clear the comboBoxItem value, or whether they are constrained to choosing one of the available options (in which case clearing the text box will simply revert to the last picked value when the user leaves the field). Note that a blank pickList line will never be shown regardless of this property's value, unlike for aSelectItem
, where it may depending uponallowEmptyValue
andmultiple
.See also
specialValues
as a way of providing several different special values in addition to an empty value, such as "Invalid". Note that settingspecialValues
disables the use ofallowEmptyValue
- see details of how to have an empty value while usingspecialValues
in inthe
.specialValues
documentation- Returns:
- Current allowEmptyValue value. Default value is true
-
setAllowExpressions
The standardFormItem.allowExpressions
behavior is always disabled for ComboBoxItem.The interface is not compatible with the
allowExpressions
feature. A ComboBoxItem normally starts fetching matches as you type, and that mixes very strangely with the idea of entering expressions like"a..b"
- you will have the ComboBox seemingly switching back and forth between treating the text as a normal search string vs as a special expression on a per-keystroke basis.We recommend a normal TextItem as the correct UI element to supply for users to enter filter expressions.
- Overrides:
setAllowExpressions
in classFormItem
- Parameters:
allowExpressions
- New allowExpressions value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getAllowExpressions
The standardFormItem.allowExpressions
behavior is always disabled for ComboBoxItem.The interface is not compatible with the
allowExpressions
feature. A ComboBoxItem normally starts fetching matches as you type, and that mixes very strangely with the idea of entering expressions like"a..b"
- you will have the ComboBox seemingly switching back and forth between treating the text as a normal search string vs as a special expression on a per-keystroke basis.We recommend a normal TextItem as the correct UI element to supply for users to enter filter expressions.
- Overrides:
getAllowExpressions
in classFormItem
- Returns:
- Current allowExpressions value. Default value is null
- See Also:
-
setAutoFetchData
If this combo box retrieves its options from adataSource
, should options be fetched from the server when the item is first written out, or should this fetch be delayed until the user opens the pickList.Note : This is an advanced setting
- Parameters:
autoFetchData
- New autoFetchData value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getAutoFetchData
If this combo box retrieves its options from adataSource
, should options be fetched from the server when the item is first written out, or should this fetch be delayed until the user opens the pickList.- Returns:
- Current autoFetchData value. Default value is false
-
setAutoOpenTree
When this item is showing a tree-based picker, which nodes should be opened automatically. Options are:- "none" - no nodes are opened automatically
- "root" - opens the top-level node - in databound tree-pickers, this node is always hidden
- "all" - when
loading data on demand
, opens the top-level node and all of it's direct descendants - otherwise, opens all loaded nodes
- Parameters:
autoOpenTree
- New autoOpenTree value. Default value is "none"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getAutoOpenTree
When this item is showing a tree-based picker, which nodes should be opened automatically. Options are:- "none" - no nodes are opened automatically
- "root" - opens the top-level node - in databound tree-pickers, this node is always hidden
- "all" - when
loading data on demand
, opens the top-level node and all of it's direct descendants - otherwise, opens all loaded nodes
- Returns:
- Current autoOpenTree value. Default value is "none"
-
setCachePickListResults
For databound pickLists (see PickList.optionDataSource), by default Smart GWT will cache and re-use datasets shown by different pickLists displayed by different SelectItems in an LRU (least recently used) caching pattern.Setting this flag to false avoids this caching for situations where it is too aggressive.
Note that this does not control re-use of data within a single pickList. To control when client-side filtering is used in ComboBoxItem, see
useClientFiltering
andfilterLocally
.- Parameters:
cachePickListResults
- New cachePickListResults value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getCachePickListResults
public boolean getCachePickListResults()For databound pickLists (see PickList.optionDataSource), by default Smart GWT will cache and re-use datasets shown by different pickLists displayed by different SelectItems in an LRU (least recently used) caching pattern.Setting this flag to false avoids this caching for situations where it is too aggressive.
Note that this does not control re-use of data within a single pickList. To control when client-side filtering is used in ComboBoxItem, see
useClientFiltering
andfilterLocally
.- Returns:
- Current cachePickListResults value. Default value is true
-
setCompleteOnEnter
If true, when the pickList is showing, the user can select the current value by hitting theEnter
key.If not explicitly set, completeOnEnter will default to false for items embedded in a
filtering interface
, true otherwise.- Parameters:
completeOnEnter
- New completeOnEnter value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getCompleteOnEnter
If true, when the pickList is showing, the user can select the current value by hitting theEnter
key.If not explicitly set, completeOnEnter will default to false for items embedded in a
filtering interface
, true otherwise.- Returns:
- Current completeOnEnter value. Default value is null
-
setCompleteOnTab
If true, when the pickList is showing, the user can select the current value by hitting theTab
key.Note that
completeOnTab
is not compatible withformatOnBlur
- Parameters:
completeOnTab
- New completeOnTab value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getCompleteOnTab
If true, when the pickList is showing, the user can select the current value by hitting theTab
key.Note that
completeOnTab
is not compatible withformatOnBlur
- Returns:
- Current completeOnTab value. Default value is null
-
setDataSetType
Whether to show the picker as a flat list, or a collapsible tree.The default value, "list", will use an instance of the pickListConstructor as the picker - "tree" will show an instance of pickTreeConstructor.
- Parameters:
dataSetType
- New dataSetType value. Default value is "list"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getDataSetType
Whether to show the picker as a flat list, or a collapsible tree.The default value, "list", will use an instance of the pickListConstructor as the picker - "tree" will show an instance of pickTreeConstructor.
- Returns:
- Current dataSetType value. Default value is "list"
-
setDefaultToFirstOption
Select the first option as the default value for this ComboBoxItem. If options are derived from a dataSource, the first value returned by the server will be used, otherwise the first value in the valueMap. If enabled, this setting overridesdefaultValue
anddefaultDynamicValue()
.- Parameters:
defaultToFirstOption
- New defaultToFirstOption value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getDefaultToFirstOption
Select the first option as the default value for this ComboBoxItem. If options are derived from a dataSource, the first value returned by the server will be used, otherwise the first value in the valueMap. If enabled, this setting overridesdefaultValue
anddefaultDynamicValue()
.- Returns:
- Current defaultToFirstOption value. Default value is false
-
getDefaultValue
Static default value for this ComboBoxItem. To default to the first option usedefaultToFirstOption
instead.- Overrides:
getDefaultValue
in classFormItem
- Returns:
- Current defaultValue value. Default value is null
- See Also:
-
com.smartgwt.client.widgets.form.fields.FormItem#defaultDynamicValue
- Enable & Disable Example
-
setDisplayField
If set, this item will display a value from another field to the user instead of showing the underlying data value for thefield name
.This property is used in two ways:
The item will display the displayField value from the
record currently being edited
ifFormItem.useLocalDisplayFieldValue
is true, (or if unset and the conditions outlined in the documentation for that property are met).If this field has an
FormItem.optionDataSource
, this property is used by default to identify which value to use as a display value in records from this related dataSource. In this usage the specified displayField must be explicitly defined in the optionDataSource to be used - seegetDisplayFieldName()
for more on this behavior.
If not usinglocal display values
, the display value for this item will be derived by performing a fetch against theoption dataSource
to find a record where thevalue field
matches this item's value, and use thedisplayField
value from that record.
In addition to this, PickList-based form items that provide a list of possible options such as theSelectItem
orComboBoxItem
will show thedisplayField
values to the user by default, allowing them to choose a new data value (seeFormItem.valueField
) from a list of user-friendly display values.This essentially allows the specified
optionDataSource
to be used as a server basedvalueMap
.If
local display values
are being used andFormItem.storeDisplayValues
is true, selecting a new value will update both the value for this field and the associated display-field value on the record being edited.Note: Developers may specify the
FormItem.foreignDisplayField
property in addition todisplayField
. This is useful for cases where the display field name in the local dataSource differs from the display field name in the optionDataSource. See the documentation forDataSourceField.foreignDisplayField
for more on this.
If a foreignDisplayField is specified, as with just displayField, iflocal display values
are being used andFormItem.storeDisplayValues
is true, when the user chooses a value the associated display-field value on the record being edited will be updated. In this case it would be set to the foreignDisplayField value from the related record. This means foreignDisplayField is always expected to be set to the equivalent field in the related dataSources.
Developers looking to display some other arbitrary field(s) from the related dataSource during editing should consider using custom PickList.pickListFields instead of setting a foreignDisplayField.Note that if
optionDataSource
is set and no valid display field is specified,FormItem.getDisplayFieldName()
will return the dataSource title field by default.If a displayField is specified for a freeform text based item (such as a
ComboBoxItem
), any user-entered value will be treated as a display value. In this scenario, items will derive the data value for the item from the first record where the displayField value matches the user-entered value. To avoid ambiguity, developers may wish to avoid this usage if display values are not unique.- Specified by:
setDisplayField
in interfacePickList
- Overrides:
setDisplayField
in classFormItem
- Parameters:
displayField
- New displayField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getDisplayField
If set, this item will display a value from another field to the user instead of showing the underlying data value for thefield name
.This property is used in two ways:
The item will display the displayField value from the
record currently being edited
ifFormItem.useLocalDisplayFieldValue
is true, (or if unset and the conditions outlined in the documentation for that property are met).If this field has an
FormItem.optionDataSource
, this property is used by default to identify which value to use as a display value in records from this related dataSource. In this usage the specified displayField must be explicitly defined in the optionDataSource to be used - seegetDisplayFieldName()
for more on this behavior.
If not usinglocal display values
, the display value for this item will be derived by performing a fetch against theoption dataSource
to find a record where thevalue field
matches this item's value, and use thedisplayField
value from that record.
In addition to this, PickList-based form items that provide a list of possible options such as theSelectItem
orComboBoxItem
will show thedisplayField
values to the user by default, allowing them to choose a new data value (seeFormItem.valueField
) from a list of user-friendly display values.This essentially allows the specified
optionDataSource
to be used as a server basedvalueMap
.If
local display values
are being used andFormItem.storeDisplayValues
is true, selecting a new value will update both the value for this field and the associated display-field value on the record being edited.Note: Developers may specify the
FormItem.foreignDisplayField
property in addition todisplayField
. This is useful for cases where the display field name in the local dataSource differs from the display field name in the optionDataSource. See the documentation forDataSourceField.foreignDisplayField
for more on this.
If a foreignDisplayField is specified, as with just displayField, iflocal display values
are being used andFormItem.storeDisplayValues
is true, when the user chooses a value the associated display-field value on the record being edited will be updated. In this case it would be set to the foreignDisplayField value from the related record. This means foreignDisplayField is always expected to be set to the equivalent field in the related dataSources.
Developers looking to display some other arbitrary field(s) from the related dataSource during editing should consider using custom PickList.pickListFields instead of setting a foreignDisplayField.Note that if
optionDataSource
is set and no valid display field is specified,FormItem.getDisplayFieldName()
will return the dataSource title field by default.If a displayField is specified for a freeform text based item (such as a
ComboBoxItem
), any user-entered value will be treated as a display value. In this scenario, items will derive the data value for the item from the first record where the displayField value matches the user-entered value. To avoid ambiguity, developers may wish to avoid this usage if display values are not unique.- Specified by:
getDisplayField
in interfacePickList
- Overrides:
getDisplayField
in classFormItem
- Returns:
- Returns the
displayField
for this item.Behavior varies based on the configuration of this item, as follows:
- If this item has an
optionDataSource
and an explicitFormItem.foreignDisplayField
is specified, this will be returned. - Otherwise if an explicit
displayField
is specified it will be returned by default. If thedisplayField
was specified on the underlying dataSource field, and no matching field is present in theoptionDataSource
for the item, we avoid returning the specified displayField value and instead return the title field of the option DataSource. We do this to avoid confusion for the case where the displayField is intended as a display-field value for showing another field value within the same record in the underlying dataSource only. - If no explicit
foreignDisplay or displayField specification was found, and the
FormItem.valueField
for this item is hidden in theFormItem.optionDataSource
, this method will return the title field for theoptionDataSource
.
- If this item has an
- See Also:
-
setEditProxyConstructor
Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.- Overrides:
setEditProxyConstructor
in classTextItem
- Parameters:
editProxyConstructor
- New editProxyConstructor value. Default value is "SelectItemEditProxy"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getEditProxyConstructor
Default class used to construct theEditProxy
for this component when the component isfirst placed into edit mode
.- Overrides:
getEditProxyConstructor
in classTextItem
- Returns:
- Current editProxyConstructor value. Default value is "SelectItemEditProxy"
- See Also:
-
setEmptyPickListMessage
Empty message to display in the comboboxItem if PickList.hideEmptyPickList isfalse
.Note : This is an advanced setting
- Specified by:
setEmptyPickListMessage
in interfacePickList
- Parameters:
emptyPickListMessage
- New emptyPickListMessage value. Default value is "No items to show"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getEmptyPickListMessage
Empty message to display in the comboboxItem if PickList.hideEmptyPickList isfalse
.- Specified by:
getEmptyPickListMessage
in interfacePickList
- Returns:
- Current emptyPickListMessage value. Default value is "No items to show"
-
setFetchDisplayedFieldsOnly
If this item has a specifiedoptionDataSource
and this property istrue
, the list of fields used by this pickList will be passed to the datasource asDSRequest.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
andpickListFields
.NOTE: When enabled,
getSelectedRecord
will only include the fetched fields.Note : This is an advanced setting
- Parameters:
fetchDisplayedFieldsOnly
- New fetchDisplayedFieldsOnly value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getFetchDisplayedFieldsOnly
If this item has a specifiedoptionDataSource
and this property istrue
, the list of fields used by this pickList will be passed to the datasource asDSRequest.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
andpickListFields
.NOTE: When enabled,
getSelectedRecord
will only include the fetched fields.- Returns:
- Current fetchDisplayedFieldsOnly value. Default value is null
-
setFilterFields
As the user types into this item's textBox, a comboBoxItem will show the pick-list of options, and filter the set of results displayed by the current value in the text box. For a databound comboBoxItem, by default the entered value is filtered against thedisplayField
if one is specified, otherwise thevalueField
.This attribute allows the developer to explicitly change which fields to filter against, causing the user-entered text to be matched against any of the specified set of fields from the
optionDataSource
.This essentially causes
getPickListFilterCriteria()
to return anAdvancedCriteria
object representing "field1 starts with value or field2 starts with value or ...". Theoperator
used is controlled byTextMatchStyle
as usual, that is, "startsWith" implies the operator "iStartsWith, "substring" implies "iContains" and "exact" implies "iEquals".The most common use case for this setting would be when a comboBoxItem is showing multiple
pickListFields
- if the same set of fields is specified asfilterFields
, the user can use the text-box to filter against whichever fields are visible in the pickList.For finer grained control over comboBoxItem filtering, the comboBoxItem.setPickListFilterCriteriaFunction() may be specified.
- Parameters:
filterFields
- New filterFields value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getFilterFields
As the user types into this item's textBox, a comboBoxItem will show the pick-list of options, and filter the set of results displayed by the current value in the text box. For a databound comboBoxItem, by default the entered value is filtered against thedisplayField
if one is specified, otherwise thevalueField
.This attribute allows the developer to explicitly change which fields to filter against, causing the user-entered text to be matched against any of the specified set of fields from the
optionDataSource
.This essentially causes
getPickListFilterCriteria()
to return anAdvancedCriteria
object representing "field1 starts with value or field2 starts with value or ...". Theoperator
used is controlled byTextMatchStyle
as usual, that is, "startsWith" implies the operator "iStartsWith, "substring" implies "iContains" and "exact" implies "iEquals".The most common use case for this setting would be when a comboBoxItem is showing multiple
pickListFields
- if the same set of fields is specified asfilterFields
, the user can use the text-box to filter against whichever fields are visible in the pickList.For finer grained control over comboBoxItem filtering, the comboBoxItem.setPickListFilterCriteriaFunction() may be specified.
- Returns:
- Current filterFields value. Default value is null
- See Also:
-
setFilterLocally
IffilterLocally
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 - when this property is set to
false
, filtering will still be performed on the client if a complete set of data for some criteria has been cached by a fetch, and a subsequent fetch has more restrictive criteria. To explicitly disable client-side filtering set theuseClientFiltering
property to false.Note : This is an advanced setting
- Specified by:
setFilterLocally
in interfacePickList
- Overrides:
setFilterLocally
in classFormItem
- Parameters:
filterLocally
- New filterLocally value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getFilterLocally
IffilterLocally
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 - when this property is set to
false
, filtering will still be performed on the client if a complete set of data for some criteria has been cached by a fetch, and a subsequent fetch has more restrictive criteria. To explicitly disable client-side filtering set theuseClientFiltering
property to false.- Specified by:
getFilterLocally
in interfacePickList
- Overrides:
getFilterLocally
in classFormItem
- Returns:
- Current filterLocally value. Default value is false
- See Also:
-
getFilterWithValue
public boolean getFilterWithValue()Read-only property set by the ComboBoxItem to indicate whether we should use the current typed-in value as part of the filter criteria returned bygetPickListFilterCriteria()
. You can check this flag in order to mimic the ComboBoxItem's default behavior if you provide a custom implementation ofgetPickListFilterCriteria()
.- Returns:
- Current filterWithValue value. Default value is varies
- See Also:
-
setFormatOnBlur
WithformatOnBlur
enabled, this comboBoxItem will format its value according to the rules described inFormItem.mapValueToDisplay()
as long as the item does not have focus. Once the user puts focus into the item the formatter will be removed. This provides a simple way for developers to show a nicely formatted display value in a freeform text field, without the need for an explicitFormItem.formatEditorValue()
andFormItem.parseEditorValue()
pair.Note that this attribute is not compatible with
completeOnTab
- Overrides:
setFormatOnBlur
in classTextItem
- Parameters:
formatOnBlur
- New formatOnBlur value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getFormatOnBlur
WithformatOnBlur
enabled, this comboBoxItem will format its value according to the rules described inFormItem.mapValueToDisplay()
as long as the item does not have focus. Once the user puts focus into the item the formatter will be removed. This provides a simple way for developers to show a nicely formatted display value in a freeform text field, without the need for an explicitFormItem.formatEditorValue()
andFormItem.parseEditorValue()
pair.Note that this attribute is not compatible with
completeOnTab
- Overrides:
getFormatOnBlur
in classTextItem
- Returns:
- Current formatOnBlur value. Default value is false
-
setGenerateExactMatchCriteria
When a comboBoxItem is used to generate search criteria in a SearchForm this property governs whether, if the user explicitly chose an option from the pickList, we explicitly generate criteria that will search for an exact match against the chosen value.In order to achieve this, when this property is set to true, this item will generate
AdvancedCriteria
in the defaultFormItemCriterionGetter
'sgetCriterion()
method.See
shouldGenerateExactMatchCriteria()
for behavior when this flag is unset.Note : This is an advanced setting
- Parameters:
generateExactMatchCriteria
- New generateExactMatchCriteria value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getGenerateExactMatchCriteria
When a comboBoxItem is used to generate search criteria in a SearchForm this property governs whether, if the user explicitly chose an option from the pickList, we explicitly generate criteria that will search for an exact match against the chosen value.In order to achieve this, when this property is set to true, this item will generate
AdvancedCriteria
in the defaultFormItemCriterionGetter
'sgetCriterion()
method.See
shouldGenerateExactMatchCriteria()
for behavior when this flag is unset.- Returns:
- Current generateExactMatchCriteria value. Default value is null
-
setIconPlacement
For PickList items withPickListItemIconPlacement
set such that the pickList does not render near-origin, should specifiedicons
be rendered inline within the formItem itself, or within thepickerNavigationBar
.May be overridden at the icon level via
FormItemIcon.iconPlacement
.For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.
- Parameters:
iconPlacement
- New iconPlacement value. Default value is "both"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getIconPlacement
For PickList items withPickListItemIconPlacement
set such that the pickList does not render near-origin, should specifiedicons
be rendered inline within the formItem itself, or within thepickerNavigationBar
.May be overridden at the icon level via
FormItemIcon.iconPlacement
.For mobile browsing with limited available screen space, icons rendered in the navigation bar may be easier for the user to interact with.
- Returns:
- Current iconPlacement value. Default value is "both"
-
setInitialSort
An array ofSortSpecifier
objects used to set up the initial sort configuration for this pickList. If specified, this will be used instead of any PickList.sortField specified.- Parameters:
initialSort
- New initialSort value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getInitialSort
An array ofSortSpecifier
objects used to set up the initial sort configuration for this pickList. If specified, this will be used instead of any PickList.sortField specified.- Returns:
- Current initialSort value. Default value is null
-
setMask
Not applicable to a ComboBoxItem.Note : This is an advanced setting
- Overrides:
setMask
in classTextItem
- Parameters:
mask
- New mask value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getMask
Not applicable to a ComboBoxItem. -
setMaskOverwriteMode
Not applicable to a ComboBoxItem.Note : This is an advanced setting
- Overrides:
setMaskOverwriteMode
in classTextItem
- Parameters:
maskOverwriteMode
- New maskOverwriteMode value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getMaskOverwriteMode
Not applicable to a ComboBoxItem.- Overrides:
getMaskOverwriteMode
in classTextItem
- Returns:
- Current maskOverwriteMode value. Default value is null
-
setMaskPadChar
Not applicable to a ComboBoxItem.Note : This is an advanced setting
- Overrides:
setMaskPadChar
in classTextItem
- Parameters:
maskPadChar
- New maskPadChar value. Default value is " "- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getMaskPadChar
Not applicable to a ComboBoxItem.- Overrides:
getMaskPadChar
in classTextItem
- Returns:
- Current maskPadChar value. Default value is " "
-
setMaskPromptChar
Not applicable to a ComboBoxItem.Note : This is an advanced setting
- Overrides:
setMaskPromptChar
in classTextItem
- Parameters:
maskPromptChar
- New maskPromptChar value. Default value is "_"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getMaskPromptChar
Not applicable to a ComboBoxItem.- Overrides:
getMaskPromptChar
in classTextItem
- Returns:
- Current maskPromptChar value. Default value is "_"
-
setMaskSaveLiterals
Not applicable to a ComboBoxItem.Note : This is an advanced setting
- Overrides:
setMaskSaveLiterals
in classTextItem
- Parameters:
maskSaveLiterals
- New maskSaveLiterals value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getMaskSaveLiterals
Not applicable to a ComboBoxItem.- Overrides:
getMaskSaveLiterals
in classTextItem
- Returns:
- Current maskSaveLiterals value. Default value is null
-
setMinimumSearchLength
Minimum length in characters before a search is performed. If too few characters are entered the pick list showssearchStringTooShortMessage
.Note : This is an advanced setting
- Parameters:
minimumSearchLength
- New minimumSearchLength value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getMinimumSearchLength
Minimum length in characters before a search is performed. If too few characters are entered the pick list showssearchStringTooShortMessage
.- Returns:
- Current minimumSearchLength value. Default value is null
-
setOptionOperationId
If this item has a specifiedoptionDataSource
, this attribute may be set to specify an explicitDSRequest.operationId
when performing a fetch against the option dataSource to pick up display value mapping.- Overrides:
setOptionOperationId
in classFormItem
- Parameters:
optionOperationId
- New optionOperationId value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getOptionOperationId
If this item has a specifiedoptionDataSource
, this attribute may be set to specify an explicitDSRequest.operationId
when performing a fetch against the option dataSource to pick up display value mapping.- Overrides:
getOptionOperationId
in classFormItem
- Returns:
- Current optionOperationId value. Default value is null
- See Also:
-
setPendingTextBoxStyle
Optional "pending" style for this item's text box.If
addUnknownValues
is false, when the user modifies the value displayed in the combobox item text box, the underlying data value (as returned from item.getValue()) is not immediately updated - instead the value is used to filter the set of results displayed in the comboBoxItem pickList.While the comboBoxItem is in this pending state (where the result of getEnteredValue() will not necessarily match the display value for whatever is returned by getValue()), the pendingTextBoxStyle may be applied to the text box for the item.
When the element value is updated to display the actual value for the item (typically due to the user selecting a value from the pickList), the standard
TextItem.textBoxStyle
will be reapplied.May be left unset in which case the standard text box style is always applied. Has no effect if
addUnknownValues
is true.- Parameters:
pendingTextBoxStyle
- New pendingTextBoxStyle value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPendingTextBoxStyle
Optional "pending" style for this item's text box.If
addUnknownValues
is false, when the user modifies the value displayed in the combobox item text box, the underlying data value (as returned from item.getValue()) is not immediately updated - instead the value is used to filter the set of results displayed in the comboBoxItem pickList.While the comboBoxItem is in this pending state (where the result of getEnteredValue() will not necessarily match the display value for whatever is returned by getValue()), the pendingTextBoxStyle may be applied to the text box for the item.
When the element value is updated to display the actual value for the item (typically due to the user selecting a value from the pickList), the standard
TextItem.textBoxStyle
will be reapplied.May be left unset in which case the standard text box style is always applied. Has no effect if
addUnknownValues
is true.- Returns:
- Current pendingTextBoxStyle value. Default value is null
- See Also:
-
getPickerClearButton
NavigationButton
to clear the picker value, created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen.This button will only be shown if
addUnknownValues
orallowEmptyValue
is true.The following
passthroughs
apply:This component is an AutoChild named "pickerClearButton". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerClearButton value. Default value is null
-
setPickerClearButtonTitle
The title for thepickerClearButton
.- Parameters:
pickerClearButtonTitle
- New pickerClearButtonTitle value. Default value is "Clear"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerClearButtonTitle
The title for thepickerClearButton
.- Returns:
- Current pickerClearButtonTitle value. Default value is "Clear"
- See Also:
-
getPickerExitButton
NavigationButton
to dismiss the picker interface, created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen.The following
passthroughs
apply:This component is an AutoChild named "pickerExitButton". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerExitButton value. Default value is null
-
setPickerExitButtonTitle
The title for thepickerExitButton
.- Parameters:
pickerExitButtonTitle
- New pickerExitButtonTitle value. Default value is "Cancel"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerExitButtonTitle
The title for thepickerExitButton
.- Returns:
- Current pickerExitButtonTitle value. Default value is "Cancel"
- See Also:
-
setPickerIconHeight
Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item.Note : This is an advanced setting
- Overrides:
setPickerIconHeight
in classFormItem
- Parameters:
pickerIconHeight
- New pickerIconHeight value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getPickerIconHeight
Don't specify an explicit height for the picker icon - instead have it size to match the height of the combo box item.- Overrides:
getPickerIconHeight
in classFormItem
- Returns:
- Current pickerIconHeight value. Default value is null
-
setPickerIconSrc
IfshowPickerIcon
is true for this item, this property governs thesrc
of the picker icon image to be displayed.When
spriting
is enabled, this property will not be used to locate an image, instead, the image is drawn via CSS based on theFormItem.pickerIconStyle
property.Note : This is an advanced setting
- Overrides:
setPickerIconSrc
in classFormItem
- Parameters:
pickerIconSrc
- New pickerIconSrc value. Default value is "[SKIN]/DynamicForm/ComboBoxItem_PickButton_icon.gif"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerIconSrc
IfshowPickerIcon
is true for this item, this property governs thesrc
of the picker icon image to be displayed.When
spriting
is enabled, this property will not be used to locate an image, instead, the image is drawn via CSS based on theFormItem.pickerIconStyle
property.- Overrides:
getPickerIconSrc
in classFormItem
- Returns:
- Current pickerIconSrc value. Default value is "[SKIN]/DynamicForm/ComboBoxItem_PickButton_icon.gif"
- See Also:
-
getPickerSaveButton
"Accept" button foraddUnknownValues:true
ComboBoxItems showing the mobile interface.The pickerSaveButton is an automatically created
NavigationButton
autoChild to dismiss the picker interface and store out the value entered in thepickerSearchField
, created whenpickListPlacement
indicates that the search interface takes over the entire panel or screen.This button will only be shown when
addUnknownValues
is true. Note that if a user has entered a partial known value, the pickList will show a filtered list of possible matches. An "Enter" keypress (or native keyboard "Done" button click on a mobile browser keyboard) will select the first match from the list. The pickerSaveButton provides a way for users to explicitly use the value as entered instead.The following
passthroughs
apply:This component is an AutoChild named "pickerSaveButton". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerSaveButton value. Default value is null
-
setPickerSaveButtonTitle
The title for thepickerSaveButton
.- Parameters:
pickerSaveButtonTitle
- New pickerSaveButtonTitle value. Default value is "Accept"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerSaveButtonTitle
The title for thepickerSaveButton
.- Returns:
- Current pickerSaveButtonTitle value. Default value is "Accept"
- See Also:
-
getPickerSearchField
ThepickerSearchField
is a separateTextItem
created for search string entry whenpickListPlacement
indicates that the search interface takes over an entire panel or the entire screen.The following
passthroughs
apply:This component is an AutoChild named "pickerSearchField". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerSearchField value. Default value is null
-
setPickerSearchFieldHint
FormItem.hint
for thepickerSearchField
.- Parameters:
pickerSearchFieldHint
- New pickerSearchFieldHint value. Default value is "Search"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerSearchFieldHint
FormItem.hint
for thepickerSearchField
.- Returns:
- Current pickerSearchFieldHint value. Default value is "Search"
- See Also:
-
getPickerSearchForm
Form that contains thepickerSearchField
.This component is an AutoChild named "pickerSearchForm". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerSearchForm value. Default value is null
-
getPickerSearchIcon
FormItemIcon displayed in thepickerSearchField
whenshowPickerSearchIcon
is true. Shows the builtin "Search" icon by default, and this can be modified or sized viapickerSearchIconSrc
andpickerSearchIconSize
.This component is an AutoChild named "pickerSearchIcon". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickerSearchIcon value. Default value is null
-
setPickerSearchIconSize
Size for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.- Parameters:
pickerSearchIconSize
- New pickerSearchIconSize value. Default value is 14- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerSearchIconSize
Size for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.- Returns:
- Current pickerSearchIconSize value. Default value is 14
- See Also:
-
setPickerSearchIconSrc
Source for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.- Parameters:
pickerSearchIconSrc
- New pickerSearchIconSrc value. Default value is "Search"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerSearchIconSrc
Source for the icon displayed in thepickerSearchField
of a full-screen picker whenshowPickerSearchIcon
is true.- Returns:
- Current pickerSearchIconSrc value. Default value is "Search"
- See Also:
-
setPickerSearchOrNewValueFieldHint
- Parameters:
pickerSearchOrNewValueFieldHint
- New pickerSearchOrNewValueFieldHint value. Default value is "Search or enter new value"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickerSearchOrNewValueFieldHint
- Returns:
- Current pickerSearchOrNewValueFieldHint value. Default value is "Search or enter new value"
- See Also:
-
getPickList
ListGrid-based AutoChild created by the system to display a list of pickable options for this item.The pickList is automatically generated and displayed by the system when necessary. It may be customized via properties such as
pickListConstructor
,pickTreeConstructor
,pickListProperties
and more. See the PickList overview for more information.Accessing the generated pickList at runtime is an advanced usage. In most cases developers should not modify this generated component directly but should instead use attributes on the formItem to configure it.
This component is an AutoChild named "pickList". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current pickList value. Default value is null
-
setPickListConstructor
The Class to use when creating a picker of type "list" for a FormItem. Must be a subclass of the builtin default,PickListMenu
.- Parameters:
pickListConstructor
- New pickListConstructor value. Default value is "PickListMenu"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickListConstructor
The Class to use when creating a picker of type "list" for a FormItem. Must be a subclass of the builtin default,PickListMenu
.- Returns:
- Current pickListConstructor value. Default value is "PickListMenu"
- See Also:
-
setPickListCriteria
If this item has a databound pickList (for example PickList.optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList.Note : This is an advanced setting
- Specified by:
setPickListCriteria
in interfacePickList
- Parameters:
pickListCriteria
- New pickListCriteria value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickListCriteria
If this item has a databound pickList (for example PickList.optionDataSource is set), this property can be used to provide static filter criteria when retrieving the data for the pickList.- Specified by:
getPickListCriteria
in interfacePickList
- Returns:
- Current pickListCriteria value. Default value is null
- See Also:
-
setPickListFields
This property allows the developer to specify which field[s] will be displayed in the drop down list of options.Only applies to databound pickLists (see PickList.optionDataSource, or pickLists with custom data set up via the advanced PickList.getClientPickListData() method.
If this property is unset, we display the PickList.displayField, if specified, otherwise the PickList.valueField.
If there are multiple fields, column headers will be shown for each field, the height of which can be customized via the PickList.pickListHeaderHeight attribute.
Each field to display should be specified as a
ListGridField
object. Note that unlike inlistGrids
, dataSource fields marked ashidden:true
will be hidden by default in pickLists. To override this behavior, ensure that you specify an explicit value forshowIf
.Note : This is an advanced setting
- Parameters:
pickListFields
- New pickListFields value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
setPickListPlacement
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Parameters:
pickListPlacement
- New pickListPlacement value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getPickListPlacement
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Returns:
- Current pickListPlacement value. Default value is null
-
setPickListPlacement
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Parameters:
pickListPlacement
- New pickListPlacement value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getPickListPlacementAsCanvas
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Returns:
- Current pickListPlacement value. Default value is null
-
setPickListPlacement
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Parameters:
pickListPlacement
- New pickListPlacement value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getPickListPlacementAsString
Controls where the PickList is placed. Can be specified as aPanelPlacement
or a specific widget that should be filled (by specifying an actual Canvas orCanvas.ID
).Default behavior is to
"fillPanel"
ifisHandset
orisTablet
, to better accommodate the smaller screen real estate and less precise pointing ability on such devices.When filling the whole screen, part of the screen or a specific panel, the expanded interface is created as a
standard FormItem picker
, and incorporates anavigation bar
andcancel button
that hides the expanded interface, as well as a separatesearch field
.- Returns:
- Current pickListPlacement value. Default value is null
-
setPickTreeConstructor
The Class to use when creating a picker of type "tree" for a FormItem. Must be a subclass of the builtin default, PickTreeMenu.- Parameters:
pickTreeConstructor
- New pickTreeConstructor value. Default value is "PickTreeMenu"- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getPickTreeConstructor
The Class to use when creating a picker of type "tree" for a FormItem. Must be a subclass of the builtin default, PickTreeMenu.- Returns:
- Current pickTreeConstructor value. Default value is "PickTreeMenu"
- See Also:
-
setProgressiveLoading
Indicates whether or not this ComboBoxItem will load its list of optionsprogressively
. This property is copied onto the underlying PickList.- Parameters:
progressiveLoading
- New progressiveLoading value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getProgressiveLoading
Indicates whether or not this ComboBoxItem will load its list of optionsprogressively
. This property is copied onto the underlying PickList.- Returns:
- Current progressiveLoading value. Default value is true
- See Also:
-
setRootNodeId
When this item is showing a tree-based picker, this is theid
of the record to use as theroot
node.- Parameters:
rootNodeId
- New rootNodeId value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getRootNodeId
When this item is showing a tree-based picker, this is theid
of the record to use as theroot
node.- Returns:
- Current rootNodeId value. Default value is null
-
setRootNodeId
When this item is showing a tree-based picker, this is theid
of the record to use as theroot
node.- Parameters:
rootNodeId
- New rootNodeId value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getRootNodeIdAsInt
When this item is showing a tree-based picker, this is theid
of the record to use as theroot
node.- Returns:
- Current rootNodeId value. Default value is null
-
setSaveOnEnter
ComboBox items will submit their containing form on enter keypress ifsaveOnEnter
is true. Setting this property tofalse
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.- Overrides:
setSaveOnEnter
in classTextItem
- Parameters:
saveOnEnter
- New saveOnEnter value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getSaveOnEnter
ComboBox items will submit their containing form on enter keypress ifsaveOnEnter
is true. Setting this property tofalse
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.- Overrides:
getSaveOnEnter
in classTextItem
- Returns:
- Current saveOnEnter value. Default value is true
-
setSearchStringTooShortMessage
Message to display in pick list whenminimumSearchLength
characters have not been entered.Note : This is an advanced setting
- Parameters:
searchStringTooShortMessage
- New searchStringTooShortMessage value. Default value is "Enter a longer search string to search"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getSearchStringTooShortMessage
Message to display in pick list whenminimumSearchLength
characters have not been entered.- Returns:
- Current searchStringTooShortMessage value. Default value is "Enter a longer search string to search"
-
setSeparateSpecialValues
If true,specialValues
special values such as the empty value will be shown in a separate non-scrolling area, in theseparateValuesList
. Aside from making these values more easily accessible, showing them in a separate list allows data paging to be used, which is disabled if the separateValues are shown in the normal drop-down list along with other values.- Parameters:
separateSpecialValues
- New separateSpecialValues value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getSeparateSpecialValues
If true,specialValues
special values such as the empty value will be shown in a separate non-scrolling area, in theseparateValuesList
. Aside from making these values more easily accessible, showing them in a separate list allows data paging to be used, which is disabled if the separateValues are shown in the normal drop-down list along with other values.- Returns:
- Current separateSpecialValues value. Default value is null
-
getSeparateValuesList
AutoChild used to showspecialValues
.This component is an AutoChild named "separateValuesList". For an overview of how to use and configure AutoChildren, see
Using AutoChildren
.- Returns:
- Current separateValuesList value. Default value is null
-
setSeparatorRows
Array of records to show between matching and non-matching rows in the PickList.Not valid for
databound pickLists
.- Specified by:
setSeparatorRows
in interfacePickList
- Parameters:
separatorRows
- New separatorRows value. Default value is [{isSeparator:true}]- Returns:
ComboBoxItem
instance, for chaining setter calls
-
setShowAllOptions
If true, even non-matching options will be shown, with configurableseparator rows
in between. Not valid fordatabound pickLists
.- Specified by:
setShowAllOptions
in interfacePickList
- Parameters:
showAllOptions
- New showAllOptions value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getShowAllOptions
If true, even non-matching options will be shown, with configurableseparator rows
in between. Not valid fordatabound pickLists
.- Specified by:
getShowAllOptions
in interfacePickList
- Returns:
- Current showAllOptions value. Default value is null
-
setShowHintInField
If showing a hint for this form item, should it be shown within the field?CSS style for the hint is
SelectItem.textBoxStyle
with the suffix "Hint" appended to it.- Overrides:
setShowHintInField
in classTextItem
- Parameters:
showHintInField
- New showHintInField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getShowHintInField
If showing a hint for this form item, should it be shown within the field?CSS style for the hint is
SelectItem.textBoxStyle
with the suffix "Hint" appended to it.- Overrides:
getShowHintInField
in classTextItem
- Returns:
- Current showHintInField value. Default value is null
- See Also:
-
setShowOptionsFromDataSource
If this item is part of a databound form, and has a specifiedvalueMap
, 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'sdataSource
.Note : This is an advanced setting
- Specified by:
setShowOptionsFromDataSource
in interfacePickList
- Parameters:
showOptionsFromDataSource
- New showOptionsFromDataSource value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getShowOptionsFromDataSource
If this item is part of a databound form, and has a specifiedvalueMap
, 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'sdataSource
.- Specified by:
getShowOptionsFromDataSource
in interfacePickList
- Returns:
- Current showOptionsFromDataSource value. Default value is null
- See Also:
-
setShowPickerIcon
Should we show a special 'picker'icon
for this form item? Picker icons are customizable viapickerIconProperties
. By default they will be rendered inside the form item's"control box"
area. By default clicking the pickerIcon will callFormItem.showPicker()
.- Overrides:
setShowPickerIcon
in classFormItem
- Parameters:
showPickerIcon
- New showPickerIcon value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getShowPickerIcon
Should we show a special 'picker'icon
for this form item? Picker icons are customizable viapickerIconProperties
. By default they will be rendered inside the form item's"control box"
area. By default clicking the pickerIcon will callFormItem.showPicker()
.- Overrides:
getShowPickerIcon
in classFormItem
- Returns:
- Current showPickerIcon value. Default value is true
-
setShowPickerSearchIcon
When set to true, shows anicon
in thepickerSearchField
of a full-screen picker.- Parameters:
showPickerSearchIcon
- New showPickerSearchIcon value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getShowPickerSearchIcon
When set to true, shows anicon
in thepickerSearchField
of a full-screen picker.- Returns:
- Current showPickerSearchIcon value. Default value is false
- See Also:
-
setShowPickListOnKeypress
Should the list of options be displayed whenever the user types into the combo-box textArea, or only when the user clicks on the pick button or uses the explicitAlt+Arrow Down
key combination?- Parameters:
showPickListOnKeypress
- New showPickListOnKeypress value. Default value is true- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getShowPickListOnKeypress
Should the list of options be displayed whenever the user types into the combo-box textArea, or only when the user clicks on the pick button or uses the explicitAlt+Arrow Down
key combination?- Returns:
- Current showPickListOnKeypress value. Default value is true
-
setSingleClickFolderToggle
When this item is showing a tree-based picker, the default behavior is for folder open-state to be toggled by double-clicking. Set this attribute to true to toggle folders on a single-click instead.Note: when set to true, users can only choose leaf-nodes, since clicking folders would simply toggle them.
- Parameters:
singleClickFolderToggle
- New singleClickFolderToggle value. Default value is false- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getSingleClickFolderToggle
public boolean getSingleClickFolderToggle()When this item is showing a tree-based picker, the default behavior is for folder open-state to be toggled by double-clicking. Set this attribute to true to toggle folders on a single-click instead.Note: when set to true, users can only choose leaf-nodes, since clicking folders would simply toggle them.
- Returns:
- Current singleClickFolderToggle value. Default value is false
-
setSortField
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Parameters:
sortField
- New sortField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getSortField
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Returns:
- Current sortField value. Default value is null
- See Also:
-
setSortField
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Parameters:
sortField
- New sortField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getSortFieldAsStringArray
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Returns:
- Current sortField value. Default value is null
- See Also:
-
setSortField
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Parameters:
sortField
- New sortField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getSortFieldAsInt
Specifies one or more fields by which this item should be initially sorted. It can be afield name
, or an array of field names - but note that, if multiple fields are supplied, then each will be sorted in the samedirection
.For full sorting control, set initialSort to a list of custom
sortSpecifiers
.This attribute can also be set to the index of a field in the fields array, but note that it will be converted to a string (field name) after initialization.
- Returns:
- Current sortField value. Default value is null
- See Also:
-
setTextMatchStyle
When applying filter criteria to pickList data, what type of matching to use.For a databound pickList (
optionDataSource
set),textMatchStyle
is sent to the server asDSRequest.textMatchStyle
.For a non-databound pickList,
textMatchStyle
is applied by filterClientPickListData().- Specified by:
setTextMatchStyle
in interfacePickList
- Parameters:
textMatchStyle
- New textMatchStyle value. Default value is "startsWith"- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getTextMatchStyle
When applying filter criteria to pickList data, what type of matching to use.For a databound pickList (
optionDataSource
set),textMatchStyle
is sent to the server asDSRequest.textMatchStyle
.For a non-databound pickList,
textMatchStyle
is applied by filterClientPickListData().- Specified by:
getTextMatchStyle
in interfacePickList
- Returns:
- Current textMatchStyle value. Default value is "startsWith"
-
setUseClientFiltering
Fordatabound
items, this property will be passed to the generated ResultSet data object for the pickList asResultSet.useClientFiltering
. Setting to false will disable filtering on the client and ensure criteria are always passed to the DataSource directly.Note : This is an advanced setting
- Parameters:
useClientFiltering
- New useClientFiltering value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls
-
getUseClientFiltering
Fordatabound
items, this property will be passed to the generated ResultSet data object for the pickList asResultSet.useClientFiltering
. Setting to false will disable filtering on the client and ensure criteria are always passed to the DataSource directly.- Returns:
- Current useClientFiltering value. Default value is null
-
setValueField
If this form item maps data values to display values by retrieving theFormItem.displayField
values from anoptionDataSource
, this property denotes the the field to use as the underlying data value in records from the optionDataSource.
If not explicitly supplied, the valueField name will be derived as described inFormItem.getValueFieldName()
.- Specified by:
setValueField
in interfacePickList
- Overrides:
setValueField
in classFormItem
- Parameters:
valueField
- New valueField value. Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getValueField
If this form item maps data values to display values by retrieving theFormItem.displayField
values from anoptionDataSource
, this property denotes the the field to use as the underlying data value in records from the optionDataSource.
If not explicitly supplied, the valueField name will be derived as described inFormItem.getValueFieldName()
.- Specified by:
getValueField
in interfacePickList
- Overrides:
getValueField
in classFormItem
- Returns:
- Getter method to retrieve the
FormItem.valueField
for this item. For items with a specifiedFormItem.optionDataSource
, this determines which field in that dataSource corresponds to the value for this item.If unset, if a
foreignKey relationship
exists between this field and the optionDataSource, this will be used, otherwise default behavior will return theFormItem.name
of this field. Default value is null - See Also:
-
addDataArrivedHandler
Add a dataArrived handler.If this item is showing a dataBound pickList, this notification method will be fired when new data arrives from the server.
- Specified by:
addDataArrivedHandler
in interfaceHasDataArrivedHandlers
- Parameters:
handler
- the dataArrived handler- Returns:
HandlerRegistration
used to remove this handler
-
defaultDynamicValue
Expression evaluated to determine thedefaultValue
when no value is provided for this item. To default to the first option usedefaultToFirstOption
instead.- Parameters:
item
- the form item itself (also available as "this")form
- the managing DynamicForm instancevalues
- the current set of values for the form as a whole- Returns:
- dynamically calculated default value for this item
-
fetchData
public void fetchData()Only applies to databound items (see PickList.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 PickList.pickListCriteria. -
fetchData
- See Also:
-
fetchData
Only applies to databound items (see PickList.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 PickList.pickListCriteria.- Parameters:
callback
- Callback to fire when the fetch completes. Callback will fire with 4 parameters:item
a pointer to the form itemdsResponse
theDSResponse
returned by the serverdata
the raw data returned by the serverdsRequest
theDSRequest
sent to the server
requestProperties
- properties to apply to the dsRequest for this fetch.
-
filterClientPickListData
Returns the data to display in the pick list.The default implementation applies the criteria returned by PickList.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 PickList.showAllOptions is set, all values are shown, with matching values shown below a separator.
- Specified by:
filterClientPickListData
in interfacePickList
- Returns:
- array of record objects to display in the pickList
-
getClientPickListData
Returns the set of data to be displayed in this item's PickList.This 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. To customize the data returned after filtering, overridefilterClientPickListData()
instead.As an example, for a formItem with
valueField
set to "valueFieldName", the default implementation would take a valueMap like the following:valueMap: { value1: "display 1", value2: "display 2" }
.. and returning the following set of records:[ { valueFieldName : "value1" }, { valueFieldName : "value2" } ]
Due to the valueMap, these records will appear as a two row pickList displayed as "display 1" and "display 2".- Specified by:
getClientPickListData
in interfacePickList
- Returns:
- Array of record objects to be displayed in the pickList. Note that when a user picks a record from the list,
the value of the field matching
item.valueField
will be picked. Also note that the fields to be displayed can be customized viaitem.pickListFields
-
getDisplayFieldName
Returns thedisplayField
for this item.Behavior varies based on the configuration of this item, as follows:
- If this item has an
optionDataSource
and an explicitFormItem.foreignDisplayField
is specified, this will be returned. - Otherwise if an explicit
displayField
is specified it will be returned by default. If thedisplayField
was specified on the underlying dataSource field, and no matching field is present in theoptionDataSource
for the item, we avoid returning the specified displayField value and instead return the title field of the option DataSource. We do this to avoid confusion for the case where the displayField is intended as a display-field value for showing another field value within the same record in the underlying dataSource only. - If no explicit
foreignDisplay or displayField specification was found, and the
FormItem.valueField
for this item is hidden in theFormItem.optionDataSource
, this method will return the title field for theoptionDataSource
.
- Specified by:
getDisplayFieldName
in interfacePickList
- Overrides:
getDisplayFieldName
in classFormItem
- Returns:
- display field name, or null if there is no separate display field to use.
See
FieldName
- If this item has an
-
getEnteredValue
Returns the raw text value that currently appears in the text field, which can differ fromFormItem.getValue()
in various cases - for example:- for items that constrain the value range, such as a
DateItem
withenforceDate
:true, or aComboBoxItem
withaddUnknownValues
:false - for items with a defined valueMap or edit value formatter and parser functions which converts display value to data value
- while the item has focus if
changeOnKeypress
is false
nearOrigin
, as is typically the case on a mobile device, this method will return the value of thepickerSearchField
.- Overrides:
getEnteredValue
in classTextItem
- Returns:
- current entered value
- for items that constrain the value range, such as a
-
getValueFieldName
Getter method to retrieve theFormItem.valueField
for this item. For items with a specifiedFormItem.optionDataSource
, this determines which field in that dataSource corresponds to the value for this item.If unset, if a
foreignKey relationship
exists between this field and the optionDataSource, this will be used, otherwise default behavior will return theFormItem.name
of this field.- Specified by:
getValueFieldName
in interfacePickList
- Overrides:
getValueFieldName
in classFormItem
- Returns:
- fieldName to use a "value field" in records from this items
FormItem.optionDataSource
-
hasAdvancedCriteria
Will this item return advancedCriteria ifDynamicForm.getValuesAsCriteria()
is called on this item's form?This method is overridden in ComboBoxItem to return true if
shouldGenerateExactMatchCriteria()
returns true, and the user has chosen an exact value from the options in the pickList. In this case we will use advancedCriteria to ensure the generated search criteria exactly matches the chosen value for this item.As with formItem.hasAdvancedCriteria() this will also return true if an
Operator
was explicitly specified for this itemSee
ComboBoxItemCriteria
for a discussion of criterion generated by a ComboBoxItem.- Overrides:
hasAdvancedCriteria
in classFormItem
- Returns:
- true if the result of getCriterion() will be an AdvancedCriteria object.
- See Also:
-
shouldGenerateExactMatchCriteria
When a comboBoxItem is used to generate search criteria in a SearchForm, if the user explicitly chose an option from the pickList, should the criterion generated by theFormItemCriterionGetter
'sgetCriterion()
method enforce a search for an exact match against the chosen value?In order to achieve this, when this property is set to true, this item will generate
AdvancedCriteria
in the defaultFormItemCriterionGetter
'sgetCriterion()
method.Default implementation will return
generateExactMatchCriteria
if specified, otherwise true if the DataSource for this itemsupports advanced criteria
, false if it does not.See
ComboBoxItemCriteria
for a discussion of criterion generated by a ComboBoxItem.- Returns:
- should getCriterion() generate exact-match search criteria when a value was explicitly chosen from this item's set of options?
-
setDefaultProperties
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
- Parameters:
comboBoxItemProperties
- properties that should be used as new defaults when instances of this class are created- See Also:
-
getPickListFilterCriteria
Returns filter criteria for options displayed for this item.See
ComboBoxFiltering
for details on how pickList filter criteria are calculated by default for a comboBoxItem.Note : this is an override point - if overridden this method will be called by the live form item during filtering. However it is recommended that developers use
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 toListGridField.setEditorType(com.smartgwt.client.widgets.form.fields.FormItem)
.- Returns:
- criteria to be used for databound or local filtering
-
setSpecialValues
Set the specialValues for this item.- Parameters:
values
- the special values
-
setSpecialValues
Set the specialValues for this item.- Parameters:
valueMap
- the special value map
-
setPickListHeight
public void setPickListHeight(int pickListHeight) Maximum height to show the pick list before it starts to scroll. Note that by default the pickList will be sized to the height required by its content so it will be taller when more rows are available as selectable options- Specified by:
setPickListHeight
in interfacePickList
- Parameters:
pickListHeight
- pickListHeight Default value is 300
-
getPickListHeight
public int getPickListHeight()Maximum height to show the pick list before it starts to scroll. Note that by default the pickList will be sized to the height required by its content so it will be taller when more rows are available as selectable options- Specified by:
getPickListHeight
in interfacePickList
- Returns:
- int
-
setEmptyPickListHeight
public void setEmptyPickListHeight(int emptyPickListHeight) Height for an empty pick list (showing the empty message), if the pick list has no records andhideEmptyPickList
isfalse
.- Specified by:
setEmptyPickListHeight
in interfacePickList
- Parameters:
emptyPickListHeight
- emptyPickListHeight Default value is 100
-
getEmptyPickListHeight
public int getEmptyPickListHeight()Height for an empty pick list (showing the empty message), if the pick list has no records andhideEmptyPickList
isfalse
.- Specified by:
getEmptyPickListHeight
in interfacePickList
- Returns:
- int
-
setHideEmptyPickList
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.- Specified by:
setHideEmptyPickList
in interfacePickList
- Parameters:
hideEmptyPickList
- hideEmptyPickList Default value is null
-
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.- Specified by:
getHideEmptyPickList
in interfacePickList
- Returns:
- Boolean
-
setPickListWidth
Default width to show the pickList. If not specified, the width of this form item's element will be used instead.- Specified by:
setPickListWidth
in interfacePickList
- Parameters:
pickListWidth
- pickListWidth Default value is null
-
getPickListWidth
Default width to show the pickList. If not specified, the width of this form item's element will be used instead.- Specified by:
getPickListWidth
in interfacePickList
- Returns:
- Integer
-
setPickListMaxWidth
Maximum width for this item's pickList. By default if the values displayed in this pickList are wider than the specifiedsetPickListWidth
the pickList will render wide enough to accomodate them. This property allows the developer to limit how wide the pickList will render.- Specified by:
setPickListMaxWidth
in interfacePickList
- Parameters:
pickListMaxWidth
- pickListMaxWidth Default value is 400
-
getPickListMaxWidth
Maximum width for this item's pickList. By default if the values displayed in this pickList are wider than the specifiedsetPickListWidth
the pickList will render wide enough to accomodate them. This property allows the developer to limit how wide the pickList will render.- Specified by:
getPickListMaxWidth
in interfacePickList
- Returns:
- Integer
-
setPickListBaseStyle
Base Style for pickList cells. As with ListGrid Cells, will have 'over', 'selected' and 'disabled' appended on changes of state for the cells.- Specified by:
setPickListBaseStyle
in interfacePickList
- Parameters:
pickListBaseStyle
- pickListBaseStyle Default value is "pickListCell"
-
getPickListBaseStyle
Base Style for pickList cells. As with ListGrid Cells, will have 'over', 'selected' and 'disabled' appended on changes of state for the cells.- Specified by:
getPickListBaseStyle
in interfacePickList
- Returns:
- String
-
setAnimatePickList
If true, when the pickList is shown, it will be shown via an animated reveal effectNote : This is an advanced setting
- Specified by:
setAnimatePickList
in interfacePickList
- Parameters:
animatePickList
- animatePickList Default value is null
-
getAnimatePickList
If true, when the pickList is shown, it will be shown via an animated reveal effect- Specified by:
getAnimatePickList
in interfacePickList
- Returns:
- Boolean
-
setAnimationTime
public void setAnimationTime(int animationTime) If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickListNote : This is an advanced setting
- Specified by:
setAnimationTime
in interfacePickList
- Parameters:
animationTime
- animationTime Default value is 200
-
getAnimationTime
public int getAnimationTime()If this.animatePickList is true - this specifies the duration of the animation effect applied when showing the pickList- Specified by:
getAnimationTime
in interfacePickList
- Returns:
- int
-
setPickListHeaderHeight
public void setPickListHeaderHeight(int pickListHeaderHeight) If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. Set to zero to suppress the headers entirely.- Specified by:
setPickListHeaderHeight
in interfacePickList
- Parameters:
pickListHeaderHeight
- pickListHeaderHeight Default value is 22
-
getPickListHeaderHeight
public int getPickListHeaderHeight()If this pick list is showing multiple fields, this property determines the height of the column headers for those fields. Set to zero to suppress the headers entirely.- Specified by:
getPickListHeaderHeight
in interfacePickList
- Returns:
- int
-
setPickListCellHeight
public void setPickListCellHeight(int pickListCellHeight) Cell Height for this item's pickList.- Specified by:
setPickListCellHeight
in interfacePickList
- Parameters:
pickListCellHeight
- pickListCellHeight Default value is 16
-
getPickListCellHeight
public int getPickListCellHeight()Cell Height for this item's pickList.- Specified by:
getPickListCellHeight
in interfacePickList
- Returns:
- int
-
setValueIconField
For Databound formItems, this property determines which columnvalueIcons
should show up in for this formItem's pickList.
If unset valueIcons show up in thedisplayField
column if specified, otherwise thevalueField
column.
In most cases only thedisplayField
orvalueField
will be visible. This property is typically only required if custompickListFields
have been specfied for this item.Note : This is an advanced setting
- Specified by:
setValueIconField
in interfacePickList
- Parameters:
valueIconField
- valueIconField Default value is null
-
getValueIconField
For Databound formItems, this property determines which columnvalueIcons
should show up in for this formItem's pickList.
If unset valueIcons show up in thedisplayField
column if specified, otherwise thevalueField
column.
In most cases only thedisplayField
orvalueField
will be visible. This property is typically only required if custompickListFields
have been specfied for this item.- Specified by:
getValueIconField
in interfacePickList
- Returns:
- String
-
setPickListCriteria
-
setFetchDelay
Description copied from interface:PickList
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. The default setting will initiate a fetch if the stops typing or pauses briefly.- Specified by:
setFetchDelay
in interfacePickList
- Parameters:
fetchDelay
- the fetch delay. defaults to 200ms
-
getFetchDelay
Description copied from interface:PickList
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. The default setting will initiate a fetch if the stops typing or pauses briefly.- Specified by:
getFetchDelay
in interfacePickList
- Returns:
- the fetch delay
-
setOptionDataSource
If set, this FormItem will derive data to show in the PickList by fetching records from the specifiedoptionDataSource
. The fetched data will be used as avalueMap
by extracting thevalueField
anddisplayField
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 settingpickListFields
.The data will be retrieved via a "fetch" operation on the DataSource, passing the
pickListCriteria
(if set) as criteria, and passingoptionFilterContext
(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 callcom.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
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 setfilterLocally
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
- Specified by:
setOptionDataSource
in interfacePickList
- Overrides:
setOptionDataSource
in classFormItem
- Parameters:
dataSource
- optionDataSource Default value is null- Returns:
ComboBoxItem
instance, for chaining setter calls- See Also:
-
getOptionDataSource
Description copied from class:FormItem
If set, this FormItem will map stored values to display values as though acom.smartgwt.client.types.ValueMap
were specified, by fetching records from the specifiedoptionDataSource
and extracting thevalueField
anddisplayField
in loaded records, to derive one valueMap entry per record loaded from the optionDataSource.With the default setting of
fetchMissingValues
, fetches will be initiated against the optionDataSource any time the FormItem has a non-null value and no corresponding display value is available. This includes when the form is first initialized, as well as any subsequent calls tosetValue()
, such as may happen whenDynamicForm.editRecord()
is called. Retrieved values are automatically cached by the FormItem.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.In a databound form, if
displayField
is specified for a FormItem andoptionDataSource
is unset,optionDataSource
will default to the form's current DataSource- Specified by:
getOptionDataSource
in interfacePickList
- Overrides:
getOptionDataSource
in classFormItem
- Returns:
- Returns the
optionDataSource
for this item.Always uses
item.optionDataSource
if specified. Otherwise, ifDataSourceField.foreignKey
was specified, uses the target DataSource. Otherwise, uses the DataSource of this item's form (if one is configured). Default value is null - See Also:
-
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). Most commonly used for databound pickListItems to retrieve the values of other fields in the record.- Overrides:
getSelectedRecord
in classFormItem
- Returns:
- the selected record or null
-
setPickListFilterCriteriaFunction
Deprecated.Set the pick list filter criteria function / handler.- Specified by:
setPickListFilterCriteriaFunction
in interfacePickList
- Parameters:
filterCriteriaFunction
- the filter criteria function
-
setPickListFilterCriteriaFunction
Set up a method to return filter criteria for options displayed for this item.See
ComboBoxFiltering
for details on how pickListCriteria are calcualted by default for a ComboBoxItem. -
setPickListProperties
Allows developers to designate aPickListMenu
as a template containing arbitrary properties to apply to the pickList that will be created for this FormItem.Note: Not every PickListMenu / ListGrid property is supported when assigned to a pickList. Where there is a dedicated API on the form item (such as
PickList.setPickListCellHeight(int)
), we recommend that be used in favor of setting the equivalent property directly using this API.PickLists and
ListGrid.setShowFilterEditor(boolean)
:ComboBoxItems
do not support settingshowFilterEditor
to true on pickListProperties. This combination of settings leads to an ambiguous user experience as the two sets of filter-criteria (those from the text-box and those from the pickList filter editor) interact with each other.
CallingsetShowFilterEditor
on the PickListMenu passed toSelectItem.setPickListProperties(com.smartgwt.client.widgets.grid.ListGrid)
is a valid way to create a filterable pickList, on a SelectItem, but this setting is not supported on a SelectItem withmultiple set to true
- this combination of settings can cause a selected value to be filtered out of view at which point further selection changes will discard that value.
In general we recommend the ComboBoxItem class (withaddUnknownValues set as appropriate
) as a better interface for filtering pickList data.- Parameters:
pickListProperties
- the pick list properties
-
setOptionFilterContext
Description copied from interface:PickList
If this item has a specifiedoptionDataSource
, and this property is
 not null, this will be passed to the datasource asRPCRequest
properties when
 performing the fetch operation on the dataSource to obtain a data-value to display-value
 mappingNote : This is an advanced setting
- Specified by:
setOptionFilterContext
in interfacePickList
- Parameters:
dsRequestProperties
- optionFilterContext Default value is null
-
getValueAsString
Return the value tracked by this form item.- Overrides:
getValueAsString
in classTextItem
- Returns:
- value of this element
-
setCanEditCriterionPredicate
The defaultcanEditCriterion()
predicate is overridden in comboBoxItem. When addUnknownValues is true, comboBoxItems allow the user to edit substring match type criteria applied to the display field (if one is specified).The user can also edit criteria attempting to match exactly against the item's field name.
- Overrides:
setCanEditCriterionPredicate
in classFormItem
- Parameters:
predicate
- the predicate to determine the form items that can edit the criterion in question- See Also:
-
setCriterionGetter
The defaultgetCriterion()
implementation returns criterion derived from the current value of this item.If
addUnknownValues
is true for this item, we implement the following behavior.
If the user explicitly selected an item from the pickList, we treat this as an attempt to explicitly match the data value. In this case returned criteria will match the selected (data) value against this item's fieldName.
If the user typed a value into the text field, we treat this as an attempt to do a substring type filter. In this case returned criteria will match the entered text value against the displayField for this item if one is specified.If
addUnknownValues
is false we always match the chosen data value against the item's fieldName.Note that
ComboBoxItem.shouldGenerateExactMatchCriteria
will be called in the case when a value was explicitly picked from the set of options. If that method returns true, we will return AdvancedCriteria with an operator specified to ensure an exact match occurs.- Overrides:
setCriterionGetter
in classFormItem
- Parameters:
getter
- provides a method to get a criterion object based on this field's current edited value(s).- See Also:
-
setCriterionSetter
The defaultsetCriterion()
implementation is overridden to support editing criterion against the display field or value field whenaddUnknownValues
is true.- Overrides:
setCriterionSetter
in classFormItem
- Parameters:
setter
- provides a method to update this field with the edited criterion
-
setPickListSort
This method sorts the pickList on one or more fields, creating the underlying JS object if needed. Pass in an array of SortSpecifiers to have the grid's data sorted by the fields in each specifier.property and in the directions specified. The grid can be sorted by any combination of fields, including fields specified in the fields array, whether visible or hidden, and'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)
andcom.smartgwt.client.widgets.grid.ListGrid#alterSort
APIs for information on making changes to the current sort configuration.- Parameters:
sortSpecifiers
- Array of SortSpecifier objects
-
setSort
Deprecated.in favor ofsetPickListSort(SortSpecifier[])
where full documentation can be read.Sorts the pickList on one or more fields.- Parameters:
sortSpecifiers
- Array of SortSpecifier objects
-
setPickListFilterCriteriaFunction(FormItemCriteriaFunction)