Module: alfresco/core/WidgetsCreator

alfresco/core/WidgetsCreator

This module was created to address the situation where a widget might want to create multiple sets of widgets but process the results in different ways. The CoreWidgetProcessing mixin was created in such a way that it would allow individual functions to be easily overridden to customize the widget creation process, and it was originally thought that a widget would only have one child widget construct. However, during subsequent development it was established that a widget might want to construct different sets of child widgets in a different way but it was only possible to override the widget process in one way. This module solves that problem by allowing a widget to always construct children in the standard. An example of its use can be found in the AlfListView.

Author:
  • Dave Draper
License:
Source:

Members

callback :function

An optional callback function to call when all the widgets have been created. It is not possible to pass a scope so a hitched (or bound) function should be supplied.
Type:
  • function
Default Value:
  • null
Source:

widgets :array

The widgets to create.
Type:
  • array
Default Value:
  • null
Source:

Methods

allWidgetsProcessed(widgets)

This will call the callback function if one has been configured.
Parameters:
Name Type Description
widgets Array An array of all the widgets that have been processed
Source:

buildWidgets(rootNode, caller)

This function is called to create the widgets. An optional rootNode argument can be passed to provide a destination for the created widgets. If a caller argument is provided then key data from it will be extracted for the creation of the widgets (such as pubSubScope, dataScope, etc).
Parameters:
Name Type Argument Description
rootNode element The node to bind the root widgets to
caller object <optional>
The calling widget or service.
Source:

constructor()

Creates a new instance of the module.
Source: