Class sap.m.TokenModule: sap/m/Token
The sap.m.Token
is a container of a single text item with a delete icon if the token is in edit mode.
Constructor Summary
new sap.m.Token(sId?, mSettings?)Constructor for a new Token. Event Summary
delete(oControlEvent)This event is fired if the user clicks the token's delete icon. press(oControlEvent)This event is fired when the user clicks on the token. select(oControlEvent)This event is fired when the token gets selected. Method Summary
sap.m.Token.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.Token with name sClassName
and enriches it with the information contained in oClassInfo
. addAriaDescribedBy(vAriaDescribedBy)Adds some ariaDescribedBy into the association ariaDescribedBy
. addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy
. attachDelete(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the delete
event of this sap.m.Token
. attachPress(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the press
event of this sap.m.Token
. attachSelect(oData?, fnFunction, oListener?)Attaches event handler fnFunction
to the select
event of this sap.m.Token
. detachDelete(fnFunction, oListener)Detaches event handler fnFunction
from the delete
event of this sap.m.Token
. detachPress(fnFunction, oListener)Detaches event handler fnFunction
from the press
event of this sap.m.Token
. detachSelect(fnFunction, oListener)Detaches event handler fnFunction
from the select
event of this sap.m.Token
. fireDelete(mArguments?)Fires event delete
to attached listeners. firePress(mArguments?)Fires event press
to attached listeners. fireSelect(mArguments?)Fires event select
to attached listeners. getAriaDescribedBy()Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy
. getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy
. getKey()Gets current value of property key
. getText()Gets current value of property text
. removeAriaDescribedBy(vAriaDescribedBy)Removes an ariaDescribedBy from the association named ariaDescribedBy
. removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy
. setEditable(bEditable)Sets a new value for property editable
. setKey(sKey)Sets a new value for property key
. setText(sText)Sets a new value for property text
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onAfterRendering,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
exit,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.m.Token(sId?, mSettings?)
Constructor for a new Token.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
- Properties
- Aggregations
- Events
- delete : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- select : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.
Parameters:
{string} | sId? | ID for the new control, generated automatically if no ID is given. |
{object} | mSettings? | Initial settings for the new control. |
Event Detail
delete(oControlEvent)
This event is fired if the user clicks the token's delete icon.
Parameters:
press(oControlEvent)
This event is fired when the user clicks on the token.
Parameters:
select(oControlEvent)
This event is fired when the token gets selected.
Parameters:
Method Detail
sap.m.Token.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Token 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.Token.
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:
{sap.m.Token} | Reference to this in order to allow method chaining |
Adds some ariaLabelledBy into the association ariaLabelledBy
.
Parameters:
{string|sap.ui.core.Control} | vAriaLabelledBy | the ariaLabelledBy to add; if empty, nothing is inserted |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
attachDelete
(oData?, fnFunction, oListener?): sap.m.Token Attaches event handler
fnFunction
to the
delete
event of this
sap.m.Token
.
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.Token
itself.
This event is fired if the user clicks the token's delete icon.
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.Token itself |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
attachPress
(oData?, fnFunction, oListener?): sap.m.Token Attaches event handler
fnFunction
to the
press
event of this
sap.m.Token
.
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.Token
itself.
This event is fired when the user clicks on the 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.Token itself |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
attachSelect
(oData?, fnFunction, oListener?): sap.m.Token Attaches event handler
fnFunction
to the
select
event of this
sap.m.Token
.
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.Token
itself.
This event is fired when the token gets selected.
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.Token itself |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
delete
event of this
sap.m.Token
.
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:
{sap.m.Token} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
press
event of this
sap.m.Token
.
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:
{sap.m.Token} | Reference to this in order to allow method chaining |
Detaches event handler
fnFunction
from the
select
event of this
sap.m.Token
.
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:
{sap.m.Token} | Reference to this in order to allow method chaining |
Fires event delete
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
Fires event press
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
Fires event select
to attached listeners.
Parameters:
{Map} | mArguments? | The arguments to pass along with the event |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
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
.
Indicates the editable status of the token. If it is set to true
, token displays a delete icon.
Default value is true
.
Returns:
{boolean} | Value of property editable |
getKey(): string
Gets current value of property
key
.
Key of the token.
Default value is
.
Returns:
{string} | Value of property key |
getSelected(): boolean
Gets current value of property
selected
.
Indicates the current selection status of the token.
Default value is false
.
Returns:
{boolean} | Value of property selected |
getText(): string
Gets current value of property
text
.
Displayed text of the token.
Default value is
.
Returns:
{string} | Value of property text |
Gets current value of property
textDirection
.
This property specifies the text directionality with enumerated options. By default, the control inherits text direction from the DOM.
Default value is Inherit
.
- Since:
- 1.28.0
Returns:
Removes all the controls in the association named ariaDescribedBy
.
Returns:
Removes all the controls in the association named ariaLabelledBy
.
Returns:
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:
Sets a new value for property
editable
.
Indicates the editable status of the token. If it is set to true
, token displays a delete icon.
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:
{sap.m.Token} | Reference to this in order to allow method chaining |
Sets a new value for property
key
.
Key of the token.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
{string} | sKey | New value for property key |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
Sets a new value for property
text
.
Displayed text of the token.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is
.
Parameters:
{string} | sText | New value for property text |
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |
Sets a new value for property
textDirection
.
This property specifies the text directionality with enumerated options. By default, the control inherits text direction from the DOM.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is Inherit
.
Parameters:
- Since:
- 1.28.0
Returns:
{sap.m.Token} | Reference to this in order to allow method chaining |