Class Alfresco.module.TagLibrary
Extends Alfresco.component.Base
TagLibrary
Module that manages the selection of tags in a form
Module that manages the selection of tags in a form
Defined in: taglibrary.js
| Field Attributes | Field Name and Description |
|---|---|
|
Balloon UI instance used for error reporting
|
|
|
Currently selected tags.
|
|
|
Object container for initialization options
|
|
|
Object literal used to generate unique tag ids
|
- Fields borrowed from class Alfresco.component.Base:
- modules, services, widgets
| Method Attributes | Method Name and Description |
|---|---|
|
findTagName(scope, tagId)
Returns the tagName given a id generated by generateTagId.
|
|
|
generateTagId(scope, tagName, action)
Generate ID alias for tag, suitable for DOM ID attribute
|
|
|
getTags()
Get all tags currently selected
|
|
|
initialize(formsRuntime)
Registers the tag library logic with the dom tree
|
|
|
onAddTag(tagName)
Triggered by a click onto one of the popular tags.
|
|
|
onAddTagButtonClick(type, args)
Adds the content of the text field as a new tag.
|
|
|
onPopularTagsLinkClicked(e, obj)
Loads the popular tags
|
|
|
onRemoveTag(tagName)
Triggered by a click on one of the selected tags
|
|
|
setCurrentTags(tags)
Sets the current list of tags.
|
|
|
setTags(tags)
Adds an array of tags to the current tags.
|
|
|
updateForm(formId, tagsFieldName)
Updates a form with the currently selected tags.
|
- Methods borrowed from class Alfresco.component.Base:
- attachLinkClickListeners, bind, createYUIButtons, destroy, fire, invokeAction, msg, onComponentLoaded, onComponentsLoaded, onReadyWrapper, refresh, setMessages, setOptions
Field Detail
{object}
balloon
Balloon UI instance used for error reporting
currentTags
Currently selected tags.
- Default Value:
- empty array
options
Object container for initialization options
{object}
tagId
Object literal used to generate unique tag ids
Method Detail
findTagName(scope, tagId)
Returns the tagName given a id generated by generateTagId.
- Parameters:
- {object} scope
- instance that contains a tagId object (which stores the generated tag id mappings)
- {string} tagId
- Tag ID
{string}
generateTagId(scope, tagName, action)
Generate ID alias for tag, suitable for DOM ID attribute
- Parameters:
- {object} scope
- instance that contains a tagId object (which stores the generated tag id mappings)
- {string} tagName
- Tag name
- action
- Returns:
- {string} A unique DOM-safe ID for the tag
getTags()
Get all tags currently selected
initialize(formsRuntime)
Registers the tag library logic with the dom tree
- Parameters:
- {object} formsRuntime
- Instance of Alfresco.forms.Form
onAddTag(tagName)
Triggered by a click onto one of the popular tags.
- Parameters:
- {string} tagName
- Tag clicked
onAddTagButtonClick(type, args)
Adds the content of the text field as a new tag.
- Parameters:
- type
- args
onPopularTagsLinkClicked(e, obj)
Loads the popular tags
- Parameters:
- e
- obj
onRemoveTag(tagName)
Triggered by a click on one of the selected tags
- Parameters:
- {string} tagName
- Tag clicked
setCurrentTags(tags)
Sets the current list of tags.
Use this method if the tags html and inputs have been generated on the server.
If you create the taglibrary in javascript, use setTags to also update the UI.
Use this method if the tags html and inputs have been generated on the server.
If you create the taglibrary in javascript, use setTags to also update the UI.
- Parameters:
- {Array} tags
- String array of tags
setTags(tags)
Adds an array of tags to the current tags.
For each tag the html is generated, this function can therefore
be used to set the tags when using the taglibrary as a client-side
only component (no tags generated on the server)
For each tag the html is generated, this function can therefore
be used to set the tags when using the taglibrary as a client-side
only component (no tags generated on the server)
- Parameters:
- {array} tags
- Array containing the tags (by name)
updateForm(formId, tagsFieldName)
Updates a form with the currently selected tags.
- Parameters:
- {string} formId
- the id of the form to update
- {string} tagsFieldName
- the name of the field to use to store the tags in