This extends the base form control module to provide
a ComboBox form control. This controls currently only supports dynamic rather than fixed options which are
retrieved and filtered by a dedicated ServiceStore
instance.
PLEASE NOTE: Because this form control uses the a ServiceStore please take care to configure the "queryAttribute", "labelAttribute", "valueAttribute" and "resultsProperty" attributes.
- Copyright:
- Copyright (C) 2005-2020 Alfresco Software Limited
- License:
- GNU Lesser General Public License, see: Open Source Licensing
- Source:
Example
{
id: "COMBO_BOX",
name: "alfresco/forms/controls/FilteringSelect",
config: {
fieldId: "COMBO_BOX_1",
name: "person",
label: "Select or name a person",
description: "The people options are provided by the OptionsService, but can be filtered via the ServiceStore",
optionsConfig: {
queryAttribute: "label",
labelAttribute: "label",
valueAttribute: "value",
publishTopic: "ALF_GET_FORM_CONTROL_OPTIONS",
publishPayload: {
resultsProperty: "options",
url: url.context + "/proxy/alfresco/api/people",
itemsAttribute: "people",
labelAttribute: "userName",
valueAttribute: "userName"
}
}
}
}
Mixes In
Members
-
autoComplete :boolean
-
This determines whether or not the ComboBox will automatically copy the first matched item into the input field as the user is typing. Defaults to false.
Type:
- boolean
- Default Value:
- false
- Source:
-
cssRequirements :object[]
-
An array of the CSS files to use with this widget.
Type:
- object[]
- Default Value:
- [{cssFile:"./css/ComboBox.css"}]
- Source:
-
placeHolder :string
-
The placeholder to be used
Type:
- string
- Since:
- 1.0.48
- Default Value:
- null
- Source:
-
showAllOptionsOnOpen :boolean
-
Indicates whether opening the drop-down menu should show all available options or just those that match the current value of the control. Defaults to true (meaning that only filtered results are displayed).
Type:
- boolean
- Since:
- 1.0.96
- Default Value:
- false
- Source:
Methods
-
createFormControl()
-
Creates a new ServiceStore object to use for retrieving and filtering the available options to be included in the ComboBox and then instantiates and returns the a Dojo ComboBox widget that is configured to use it.
- Source:
-
getWidgetConfig()
-
- Source:
-
setupChangeEvents()
-
Extends the mixed in setupChangeEvents to listen to selection events.
- Source:
-
setValue(value)
-
Extends the inherited function to reset the ComboBox if the empty string is set as the value.
Parameters:
Name Type Description value
object - Source: