class sap.m.ObjectMarker

Control sample: sap.m.ObjectMarker
Visiblity: public
UX Guidelines: Object Marker
Implements:
Available since: N/A
Module: sap/m/ObjectMarker
Application Component: CA-UI5-CTR

The sap.m.ObjectMarker control represents one of the following predefined types:

Note: Use the LockedBy/UnsavedBy type along with the additionalInfo property to display the name of the user who locked/changed the object. If additionalInfo property is not set when using LockedBy/UnsavedBy types, the string "Locked by another user"/"Unsaved changes by another user" will be displayed. If you don't want to display name of the user, simply use the Locked/Unsaved types.

This control can be a drag source.

Constructor

Constructor for a new ObjectMarker.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.

new sap.m.ObjectMarker(sId?, mSettings?)
Param Type Default Value Description
sId? string

ID for the new control, generated automatically if no ID is given

mSettings? object

Initial settings for the new control


Properties

Name Type Default Value Description
additionalInfo string empty string

Sets additional information to the displayed type.

Note: If no type is set, the additional information will not be displayed.

Visibility: public
type sap.m.ObjectMarkerType

Sets one of the predefined types.

Note: If the visibility property is not specified explicitly, every type comes with predefined one as follows:

  • For Flagged and Favorite the icon is visible and the text is not displayed
  • For Draft the text is visible and the icon is not displayed
  • For Locked, LockedBy, Unsaved and UnsavedBy - on screens larger than 600px both icon and text are visible, otherwise only the icon

Visibility: public
visibility sap.m.ObjectMarkerVisibility

Sets one of the visibility states. Visibility states are as follows:

  • IconOnly - displays only icon, regardless of the screen size
  • TextOnly - displays only text, regardless of the screen size
  • IconAndText - displays both icon and text, regardless of the screen size

Visibility: public

Aggregations

Default Aggregation:

Name Cardinality Type Description
_innerControl 0..1 sap.ui.core.Control

Internal control that should be sap.m.Link for interactive and sap.m.Text for non-interactive ObjectMarker.


Associations

Name Cardinality Type Description
ariaDescribedBy 0..n sap.ui.core.Control

Association to controls / ids which describe this control (see WAI-ARIA attribute aria-describedby).

ariaLabelledBy 0..n sap.ui.core.Control

Association to controls / ids which label this control (see WAI-ARIA attribute aria-labelledby).


Events Overview

Event Description
press

Event is fired when the ObjectMarker is interactive and the user taps/clicks on it.

press

Event is fired when the ObjectMarker is interactive and the user taps/clicks on it.

Param Type Description
oControlEvent sap.ui.base.Event
getSource sap.ui.base.EventProvider
getParameters object

Methods Overview

Method Description
addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

attachPress

Attaches event handler fnFunction to the press event of this sap.m.ObjectMarker.

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.ObjectMarker itself.

Event is fired when the ObjectMarker is interactive and the user taps/clicks on it.

detachPress

Detaches event handler fnFunction from the press event of this sap.m.ObjectMarker.

The passed function and listener object must match the ones used for event registration.

sap.m.ObjectMarker.extend

Creates a new subclass of class sap.m.ObjectMarker 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.

firePress

Fires event press to attached listeners.

getAdditionalInfo

Gets current value of property additionalInfo.

Sets additional information to the displayed type.

Note: If no type is set, the additional information will not be displayed.

Default value is empty string.

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.

sap.m.ObjectMarker.getMetadata

Returns a metadata object for class sap.m.ObjectMarker.

getType

Gets current value of property type.

Sets one of the predefined types.

Note: If the visibility property is not specified explicitly, every type comes with predefined one as follows:

  • For Flagged and Favorite the icon is visible and the text is not displayed
  • For Draft the text is visible and the icon is not displayed
  • For Locked, LockedBy, Unsaved and UnsavedBy - on screens larger than 600px both icon and text are visible, otherwise only the icon

getVisibility

Gets current value of property visibility.

Sets one of the visibility states. Visibility states are as follows:

  • IconOnly - displays only icon, regardless of the screen size
  • TextOnly - displays only text, regardless of the screen size
  • IconAndText - displays both icon and text, regardless of the screen size

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

setAdditionalInfo

Sets a new value for property additionalInfo.

Sets additional information to the displayed type.

Note: If no type is set, the additional information will not be displayed.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

setType

Sets a new value for property type.

Sets one of the predefined types.

Note: If the visibility property is not specified explicitly, every type comes with predefined one as follows:

  • For Flagged and Favorite the icon is visible and the text is not displayed
  • For Draft the text is visible and the icon is not displayed
  • For Locked, LockedBy, Unsaved and UnsavedBy - on screens larger than 600px both icon and text are visible, otherwise only the icon

When called with a value of null or undefined, the default value of the property will be restored.

setVisibility

Sets a new value for property visibility.

Sets one of the visibility states. Visibility states are as follows:

  • IconOnly - displays only icon, regardless of the screen size
  • TextOnly - displays only text, regardless of the screen size
  • IconAndText - displays both icon and text, regardless of the screen size

When called with a value of null or undefined, the default value of the property will be restored.

addAriaDescribedBy

Adds some ariaDescribedBy into the association ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to add; if empty, nothing is inserted

addAriaLabelledBy

Adds some ariaLabelledBy into the association ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to add; if empty, nothing is inserted

attachPress

Attaches event handler fnFunction to the press event of this sap.m.ObjectMarker.

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.ObjectMarker itself.

Event is fired when the ObjectMarker is interactive and the user taps/clicks on it.

Param Type DefaultValue Description
oData object

An application-specific payload object that will be passed to the event handler along with the event object when firing the event

fnFunction function(sap.ui.base.Event) : void

The function to be called when the event occurs

oListener object

Context object to call the event handler with. Defaults to this sap.m.ObjectMarker itself

detachPress

Detaches event handler fnFunction from the press event of this sap.m.ObjectMarker.

The passed function and listener object must match the ones used for event registration.

Param Type DefaultValue Description
fnFunction function(sap.ui.base.Event) : void

The function to be called, when the event occurs

oListener object

Context object on which the given function had to be called

sap.m.ObjectMarker.extend

Creates a new subclass of class sap.m.ObjectMarker 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.

Param Type DefaultValue Description
sClassName string

Name of the class being created

oClassInfo object

Object literal with information about the class

FNMetaImpl function

Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class

firePress

Fires event press to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

getAdditionalInfo

Gets current value of property additionalInfo.

Sets additional information to the displayed type.

Note: If no type is set, the additional information will not be displayed.

Default value is empty string.

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.

sap.m.ObjectMarker.getMetadata

Returns a metadata object for class sap.m.ObjectMarker.

getType

Gets current value of property type.

Sets one of the predefined types.

Note: If the visibility property is not specified explicitly, every type comes with predefined one as follows:

getVisibility

Gets current value of property visibility.

Sets one of the visibility states. Visibility states are as follows:

removeAllAriaDescribedBy

Removes all the controls in the association named ariaDescribedBy.

removeAllAriaLabelledBy

Removes all the controls in the association named ariaLabelledBy.

removeAriaDescribedBy

Removes an ariaDescribedBy from the association named ariaDescribedBy.

Param Type DefaultValue Description
vAriaDescribedBy int sap.ui.core.ID sap.ui.core.Control

The ariaDescribedBy to be removed or its index or ID

removeAriaLabelledBy

Removes an ariaLabelledBy from the association named ariaLabelledBy.

Param Type DefaultValue Description
vAriaLabelledBy int sap.ui.core.ID sap.ui.core.Control

The ariaLabelledBy to be removed or its index or ID

setAdditionalInfo

Sets a new value for property additionalInfo.

Sets additional information to the displayed type.

Note: If no type is set, the additional information will not be displayed.

When called with a value of null or undefined, the default value of the property will be restored.

Default value is empty string.

Param Type DefaultValue Description
sAdditionalInfo string ""

New value for property additionalInfo

setType

Sets a new value for property type.

Sets one of the predefined types.

Note: If the visibility property is not specified explicitly, every type comes with predefined one as follows:

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sType sap.m.ObjectMarkerType

New value for property type

setVisibility

Sets a new value for property visibility.

Sets one of the visibility states. Visibility states are as follows:

When called with a value of null or undefined, the default value of the property will be restored.

Param Type DefaultValue Description
sVisibility sap.m.ObjectMarkerVisibility

New value for property visibility