Module: alfresco/forms/controls/FilteringSelect

alfresco/forms/controls/FilteringSelect

This extends the base form control module to provide a FilteringSelect 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.

Author:
  • Dave Draper
License:
Source:

Example

Example configuration

{
   id: "FILTERING_SELECT",
   name: "alfresco/forms/controls/FilteringSelect",
   config: {
      fieldId: "FILTERING_SELECT_1",
      name: "person",
      label: "Select 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"
         }
      }
   }
}

Members

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/ComboBox.css"}]
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 FilteringSelect widget that is configured to use it.
Source:

getWidgetConfig()

Source:

onFilteringValidation(message)

This function is hitched to the Dojo FilteringSelect widgets displayMessage function and is used to control the overall validation for the widget so that it works with other Aikau form controls.
Parameters:
Name Type Description
message string The error message to display (this will be null if value is valid)
Source:

setValue(value)

Extends the inherited function to reset the FilteringSelect if the empty string is set as the value.
Parameters:
Name Type Description
value object
Source: