sap.m.Tokenizer.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Tokenizer with name
sClassName
and enriches it with the information contained in
oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Control.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.m.Tokenizer.
Returns:
Adds some ariaDescribedBy into the association ariaDescribedBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaDescribedBy | the ariaDescribedBy to add; if empty, nothing is inserted |
Returns:
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
Returns:
Adds some token to the aggregation tokens
.
Parameters:
{sap.m.Token} | oToken | the token to add; if empty, nothing is inserted |
Returns:
addValidateToken(oParameters)
Function validates the given text and adds a new token if validation was successful
Parameters:
{object} | oParameters | parameter bag containing following fields: {sap.m.String} text - the source text {sap.m.Token} [optional] token - a suggested token {object} [optional] suggestionObject - any object used to find the suggested token {function} [optional] validationCallback - callback which gets called after validation has finished |
addValidator(fValidator)
Function adds an validation callback called before any new token gets added to the tokens aggregation
Parameters:
Attaches event handler
fnFunction
to the
tokenChange
event of this
sap.m.Tokenizer
.
When called, the context of the event handler (its this
) will be bound to oListener
if specified, otherwise it will be bound to this sap.m.Tokenizer
itself.
fired when the tokens aggregation changed (add / remove token)
Parameters:
{object} | oData? | An application-specific payload object that will be passed to the event handler along with the event object when firing the event |
{function} | fnFunction | The function to be called when the event occurs |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.m.Tokenizer itself |
Returns:
Destroys all the tokens in the aggregation tokens
.
Returns:
Detaches event handler
fnFunction
from the
tokenChange
event of this
sap.m.Tokenizer
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to be called, when the event occurs |
{object} | oListener | Context object on which the given function had to be called |
Returns:
Fires event
tokenChange
to attached listeners.
Expects the following event parameters:
type
of type string
type of tokenChange event. There are four TokenChange types: "added", "removed", "removedAll", "tokensChanged". Use Tokenizer.TokenChangeType.Added for "added", Tokenizer.TokenChangeType.Removed for "removed", Tokenizer.TokenChangeType.RemovedAll for "removedAll" and Tokenizer.TokenChangeType.TokensChanged for "tokensChanged".token
of type sap.m.Token
the added token or removed token. This parameter is used when tokenChange type is "added" or "removed".tokens
of type sap.m.Token[]
the array of removed tokens. This parameter is used when tokenChange type is "removedAll".addedTokens
of type sap.m.Token[]
the array of tokens that are added. This parameter is used when tokenChange type is "tokenChanged".removedTokens
of type sap.m.Token[]
the array of tokens that are removed. This parameter is used when tokenChange type is "tokenChanged".
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy
.
Returns:
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
.
Returns:
getEditable(): boolean
Gets current value of property
editable
.
true if tokens shall be editable otherwise false
Default value is true
.
Returns:
{boolean} | Value of property editable |
Function returns the internally used scroll delegate
Returns:
getScrollWidth()
Function returns the tokens' width
Function returns all currently selected tokens
Returns:
{sap.m.Token[]} | - array of selected tokens or empty array |
Gets content of aggregation
tokens
.
the currently displayed tokens
Returns:
Gets current value of property
width
.
Defines the width of the Tokenizer.
Returns:
indexOfToken(oToken): int
Checks for the provided sap.m.Token
in the aggregation tokens
. and returns its index if found or -1 otherwise.
Parameters:
{sap.m.Token} | oToken | The token whose index is looked for |
Returns:
{int} | The index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a token into the aggregation tokens
.
Parameters:
{sap.m.Token} | oToken | the token to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the token should be inserted at; for a negative value of iIndex , the token is inserted at position 0; for a value greater than the current size of the aggregation, the token is inserted at the last position |
Returns:
Removes all the controls in the association named ariaDescribedBy
.
Returns:
Removes all the controls in the association named ariaLabelledBy
.
Returns:
Removes all the controls from the aggregation
tokens
.
Additionally, it unregisters them from the hosting UIArea.
Returns:
{sap.m.Token[]} | An array of the removed elements (might be empty) |
removeAllValidators()
Function removes all validation callbacks
Removes an ariaDescribedBy from the association named ariaDescribedBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaDescribedBy | The ariaDescribedByto be removed or its index or ID |
Returns:
Removes an ariaLabelledBy from the association named ariaLabelledBy
.
Parameters:
{int|string|sap.ui.core.Control} | vAriaLabelledBy | The ariaLabelledByto be removed or its index or ID |
Returns:
Function removes all selected tokens
Returns:
Removes a token from the aggregation tokens
.
Parameters:
{int|string|sap.m.Token} | vToken | The tokento remove or its index or id |
Returns:
removeValidator(fValidator)
Function removes an validation callback
Parameters:
scrollToEnd(bInitialize)
Function scrolls the tokens to the end
Parameters:
{boolean} | bInitialize | indicates if we should reset the 'scroll-to-end-pending' flag; if true we would reset this flag |
scrollToStart()
Function scrolls the tokens to the start
Function selects all tokens
Parameters:
{boolean} | optional? | bSelect - true for selecting, false for deselecting |
Returns:
Sets a new value for property
editable
.
true if tokens shall be editable otherwise false
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Parameters:
{boolean} | bEditable | New value for property editable |
Returns:
setPixelWidth(nWidth)
Function sets the tokenizer's width in pixels
Parameters:
{number} | nWidth | the new width in pixels |
Sets a new value for property
width
.
Defines the width of the Tokenizer.
When called with a value of null
or undefined
, the default value of the property will be restored.
Parameters:
Returns: