Module: alfresco/forms/controls/PushButtons

alfresco/forms/controls/PushButtons

An input control that offers the functionality of radio-buttons or checkboxes, rendered as a single control with push-button options.

Since:
  • 1.0.44
Author:
  • Martin Doyle
License:
Source:

Examples

Sample configuration (uses noWrap and percentGap overrides):

{
   name: "alfresco/forms/controls/PushButtons",
   id: "CAN_BUILD",
   config: {
      name: "canbuild",
      label: "Can we build it?",
      noWrap: true,
      percentGap: 5,
      optionsConfig: {
         fixed: [
            {
               label: "Yes we can",
               value: true
            },
            {
               label: "No we can't",
               value: false
            }
         ]
      }
   }
}

Sample configuration (uses custom theme, ficed-width, multi-value mode properties):

{
   name: "alfresco/forms/controls/PushButtons",
   id: "PROPER_FOOTBALL",
   config: {
      additionalCssClasses: "grey-gradient",
      name: "properfootball",
      label: "Only proper form of football?",
      width: 400,
      multiMode: true,
      optionsConfig: {
         publishTopic: "GET_FOOTBALL_OPTIONS",
         publishGlobal: true
      }
   }
}

Members

firstValueIsDefault :boolean

When set to true, and this is a multi-value control, then the initial value will - if nothing is specifically set - be set to the first value available.
Type:
  • boolean
Since:
  • 1.0.65
Default Value:
  • false
Source:

noButtonsLabel :string

An optional message to display when there are no buttons available for display.
Type:
  • string
Since:
  • 1.0.80
Default Value:
  • null
Source:

Methods

alfDisabled(status)

Extends the inherited function to ensure that the control is disabled.
Parameters:
Name Type Description
status boolean Whether or not the control should be disabled
Since:
  • 1.0.80
Source:

createFormControl(config) → {object}

Creates a new ServiceStore object to use for retrieving and filtering the available options to be included in the control and then instantiates and returns the PushButtonsControl widget that is configured to use it.
Parameters:
Name Type Description
config object Configuration for the control
Source:
Returns:
The new control
Type
object

getWidgetConfig() → {object}

Construct the config for the wrapped control.
Source:
Returns:
The configuration for the form control.
Type
object

postCreate()

Run after widget created.
Source:

setOptions(options)

Extends the inherited function to make use of any configured noButtonsLabel when an empty options array is provided.
Parameters:
Name Type Description
options object[] An array of the options to be added.
Since:
  • 1.0.80
Source: