Module: alfresco/pickers/PickedItems

alfresco/pickers/PickedItems

This extends the abstract document list view to define a widget for rendering items that have been selected from a picker. The key difference is that this widget does not listen for "bulk" data deliveries but rather renders individual items as they are published. It also provides the ability to remove items from the current selection. The ultimate purpose it to be able to provide a value that is an array of selected items (e.g. for use in a form control).

Author:
  • Dave Draper
  • David Webster
License:
Source:

Members

allowNone :Boolean

If true, allow zero items to be selected
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/PickedItems.properties"}]
Source:

i18nScope :string

Set the i18n scope so that it's possible to pick up the overridden "no items" message.
Type:
  • string
Default Value:
  • "alfresco.pickers.PickedItems"
Source:

invalidTopic :string

Topic published when picker is invalid
Type:
  • string
Default Value:
  • "ALF_PICKER_INVALID"
Source:

itemKey :string

This is the dot-notation path to the attribute in the item that is the unique key. It is used to ensure that duplicate items are not added and also so that items can be removed.
Type:
  • string
Default Value:
  • "nodeRef"
Source:

singleItemMode :Boolean

If true, forces user to choose a single item only.
Type:
  • Boolean
Default Value:
  • false
Source:

validTopic :string

Topic published when picker is valid
Type:
  • string
Default Value:
  • "ALF_PICKER_VALID"
Source:

widgets :object[]

The widgets to be processed to generate each item in the rendered view.
Type:
  • object[]
Source:

<inner> publishValidityGlobally

Should picker validity be published globally?
Source:

Methods

addPickedItem(payload)

Handles published information about picked items and renders the item in the view.
Parameters:
Name Type Description
payload object The details of the item that has been picked
Source:

findPickedItem(targetKey) → {object}

This module searches the current data set to try to find an item with the supplied key. The key is matched against the dot-notation path to an attribute located in each object. By default, the key looks for the nodeRef attribute in an item structure that matches data returned for a standard document list.
Parameters:
Name Type Description
targetKey string The value to match against a key
Source:
Returns:
A matching item or null if one could not be found
Type
object

isValid()

Called to determine if this control is valid or not & send the appropriate flags if it isn't.
Source:

onReorder(adjustment, item)

Re-orders the item in the current data.
Parameters:
Name Type Description
adjustment number How to adjust the position, e.g. -1 to move up, 1 to move down
item object The item to move.
Source:

onSetPickedItems(payload)

Handles requests to set the picked items via a publication.
Parameters:
Name Type Description
payload object
Source:

postCreate()

Implements the widget life-cycle method to add drag-and-drop upload capabilities to the root DOM node. This allows files to be dragged and dropped from the operating system directly into the browser and uploaded to the location represented by the document list.
Source:

removePickedItem(payload)

Handles published information about previously picked items that have been removed. It finds the item, removes it from the current data set and then re-renders the data
Parameters:
Name Type Description
payload object The details of the item that has been picked
Source:

setPickedItems()

Sets and renders the supplied items
Source:

<inner> clearData()

Reset the current Data object.
Source: