Module: alfresco/forms/LayoutMixin

alfresco/forms/LayoutMixin

This module can be mixed into modules that extend layout controls such as AlfTabContainer to create layout widgets that can be used in forms. It aliases the functions that a Form expects to find in immediate descendent widgets and makes the necessary calls to its children. By default the children are expected to be found in the _processedWidgets attribute but if this is not the case then the getFormLayoutChildren should be overridden to return the form controls that the layout widget contains.
Author:
  • Dave Draper
License:
Source:

Methods

addChildFormControlValue(values, widget, index)

Parameters:
Name Type Description
values object The object to set with the value of the supplied widget
widget object The widget to get the value from
index number The index of the widget
Source:

addFormControlValue(values)

Iterates over the array of processed widgets and adds the value of each to the supplied object
Parameters:
Name Type Description
values object The object to set with the values from each form control
Source:

alfDisabled(status)

Iterates over the child form controls and updates their disablement status
Parameters:
Name Type Description
status boolean The boolean status to set the disablity state of the field to.
Since:
  • 1.0.83
Source:

alfRequired(status)

Iterates over the child form controls and updates their requirement status
Parameters:
Name Type Description
status boolean The boolean value to change the requirement state to
Since:
  • 1.0.83
Source:

alfVisible(status)

Iterates over the child form controls and updates their visibility status
Parameters:
Name Type Description
status boolean The boolean value to change the visibility state to.
Since:
  • 1.0.83
Source:

getFormLayoutChildren() → {object[]}

Returns the children to iterate over. Each child is expected to be a form control.
Source:
Returns:
An array of the form controls to iterate over.
Type
object[]

postMixInProperties(status)

Sets up the rules for groups visibility, requirement and disablement.
Parameters:
Name Type Description
status boolean The boolean status to set the disablity state of the field to.
Since:
  • 1.0.83
Source:

publishChildValue(deferred, widget, index)

This is called by the publishValue function for each of the child form controls in the row and calls its publishValue function.
Parameters:
Name Type Argument Description
deferred Deferred <optional>
A deferred object can optionally be passed. This will only be resolved as widget value
widget object The widget to validate
index number The index of the widget to validate
Source:

publishValue(deferred)

Iterates over the child form controls and publishes the value of each one.
Parameters:
Name Type Argument Description
deferred Deferred <optional>
A deferred object can optionally be passed. This will only be resolved as widget value
Source:

updateChildFormControlValue(values, initialization, widget, index)

Parameters:
Name Type Description
values object The object to set with the value of the supplied widget
initialization boolean Indicates whether this call is part of the initialization of the containing form
widget object The widget to get the value from
index number The index of the widget
Source:

updateFormControlValue(values, initialization)

Parameters:
Name Type Description
values object The object to set the each form control value from
initialization boolean Indicates whether this call is part of the initialization of the containing form
Source:

validateChildFormControlValue(widget, index)

Parameters:
Name Type Description
widget object The widget to validate
index number The index of the widget to validate
Source:

validateFormControlValue()

Iterates over the child form controls and validates each one.
Source: