Module: alfresco/buttons/AlfButton

alfresco/buttons/AlfButton

This extends the default Dojo button to provide Alfresco specific styling. It also overrides the onClick function to publish the publishPayload on the publishTopic

The following additionalCssClasses are built in and can be included if required:

  • call-to-action: The AlfButton is rendered in call-to-action colours
  • primary-call-to-action: The AlfButton is rendered in primary-call-to-action colours
  • biggerBolder: The AlfButton is rendered with a bigger, bold font
Author:
  • Dave Draper
License:
Source:

Extends

  • module:dijit/form/Button

Members

additionalCssClasses :string

Additional classes to be applied to the root DOM element.
Type:
  • string
Source:

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/AlfButton.css"}]
Source:

disableOnInvalidControls :boolean

Indicates whether or not the button should disable itself if any controls publish information indicating that they are in an invalid state.
Type:
  • boolean
Default Value:
  • false
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/AlfButton.properties"}]
Source:

invalidControls :object[]

This will be instantiated as an array and used to keep track of any controls that report themselves as being in an invalid state. The button should only be enabled when this list is empty.
Type:
  • object[]
Default Value:
  • null
Source:

invalidTopic :string

The topic to listen to to determine when the button should be disabled
Type:
  • string
Default Value:
  • "ALF_INVALID_CONTROL"
Source:

publishPayload :object

The payload to publish when the button is clicked
Type:
  • object
Default Value:
  • null
Source:

publishTopic :string

The topic to publish when the button is clicked
Type:
  • string
Source:

title :string

An optional title attribute to be added to the button.
Type:
  • string
Since:
  • 1.0.49
Default Value:
  • null
Source:

triggerTopic :string

An optional topic that can be provided that when published will call onClick.
Type:
  • string
Since:
  • 1.0.86
Default Value:
  • null
Source:

updatePayload :boolean

This attribute has been provided primarily for use when configuring widgetsAdditionalButtons in a form. It is a simple marker indicating whether or not the configured payload should be updated with additional data (such as the form value) or if it should be left with the original data.
Type:
  • boolean
Since:
  • 1.0.81
Default Value:
  • true
Source:

validTopic :string

The topic to listen to to determine when the button should be enabled
Type:
  • string
Default Value:
  • "ALF_VALID_CONTROL"
Source:

Methods

activate()

Cause this button to respond as if it had been clicked. The button will only act as though it has been clicked if it is not disabled when the function is called.
Since:
  • 1.0.49
Source:

onClick(evt)

Handles click events to publish the publishPayload on the publishTopic
Parameters:
Name Type Description
evt object The click event
Source:

onInvalidControl(payload)

Handles the reporting of an invalid field. This will disable the button to prevent users from clicking it.
Parameters:
Name Type Description
payload object The published details of the invalid field.
Source:

onValidControl(payload)

Handles the reporting of a valid field. If the field was previously recorded as being invalid then it is removed from the invalidControls attribute and it was the field was the only field in error then the "OK" button is enabled.
Parameters:
Name Type Description
payload object The published details of the field that has become valid
Source:

postCreate()

Extends the default Dojo button implementation to add a widget DOM node CSS class to ensure that the CSS selectors are matched.
Source:

postMixInProperties()

Extends the default implementation to check that the publishPayload attribute has been set to something other null and if it hasn't initialises it to a new (empty) object.
Source: