class sap.ui.comp.variants.VariantItem

Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/variants/VariantItem
Application Component: CA-UI5-CMP

The VariantItem class describes a variant item.


Constructor

Constructor for a new variants/VariantItem.

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.ui.comp.variants.VariantItem(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
_contexts object empty object

Assigned contexts.

Since: 1.88.

Visibility: hidden
accessOptions string

Flags for a variant to indicate why it might be read-only.

Since: 1.26.0.

Visibility: public
author string

Author of the variant

Since: 1.38.0.

Visibility: public
executeOnSelection boolean false

Attribute for usage in SmartFilterBar

Since: 1.26.0.

Visibility: public
favorite boolean false

Indicates if favorites can be created.

Since: 1.50.0.

Visibility: public
global boolean

Indicator if a variant is visible for all users.

Since: 1.26.0.

Visibility: public
labelReadOnly boolean false

Indicates if the variant title can be changed.

Since: 1.26.0.

Visibility: public
lifecyclePackage string

ABAP package the variant is assigned to. Used for transport functionality.

Since: 1.26.0.

Visibility: public
lifecycleTransportId string

Identifier of the transport object the variant is assigned to.

Since: 1.26.0.

Visibility: public
namespace string

Variant namespace

Since: 1.26.0.

Visibility: public
readOnly boolean false

If set to false, the user is allowed to change the item's data

Since: 1.26.0.

Visibility: public

Events Overview

Event Description
change

This event is fired when one of the properties is changed.

change

This event is fired when one of the properties is changed.

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

Name of the changed property


Methods Overview

Method Description
attachChange

Attaches event handler fnFunction to the change event of this sap.ui.comp.variants.VariantItem.

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.ui.comp.variants.VariantItem itself.

This event is fired when one of the properties is changed.

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.comp.variants.VariantItem.

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

sap.ui.comp.variants.VariantItem.extend

Creates a new subclass of class sap.ui.comp.variants.VariantItem 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.Item.extend.

fireChange

Fires event change to attached listeners.

getAccessOptions

Gets current value of property accessOptions.

Flags for a variant to indicate why it might be read-only.

Since 1.28.0 Replaced by property <code>labelReadOnly</code>
getAuthor

Gets current value of property author.

Author of the variant

getExecuteOnSelection

Gets current value of property executeOnSelection.

Attribute for usage in SmartFilterBar

Default value is false.

getFavorite

Gets current value of property favorite.

Indicates if favorites can be created.

Default value is false.

getGlobal

Gets current value of property global.

Indicator if a variant is visible for all users.

getLabelReadOnly

Gets current value of property labelReadOnly.

Indicates if the variant title can be changed.

Default value is false.

getLifecyclePackage

Gets current value of property lifecyclePackage.

ABAP package the variant is assigned to. Used for transport functionality.

getLifecycleTransportId

Gets current value of property lifecycleTransportId.

Identifier of the transport object the variant is assigned to.

sap.ui.comp.variants.VariantItem.getMetadata

Returns a metadata object for class sap.ui.comp.variants.VariantItem.

getNamespace

Gets current value of property namespace.

Variant namespace

getReadOnly

Gets current value of property readOnly.

If set to false, the user is allowed to change the item's data

Default value is false.

setAccessOptions

Sets a new value for property accessOptions.

Flags for a variant to indicate why it might be read-only.

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

Since 1.28.0 Replaced by property <code>labelReadOnly</code>
setAuthor

Sets a new value for property author.

Author of the variant

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

setExecuteOnSelection

Sets a new value for property executeOnSelection.

Attribute for usage in SmartFilterBar

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

Default value is false.

setFavorite

Sets a new value for property favorite.

Indicates if favorites can be created.

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

Default value is false.

setGlobal

Sets a new value for property global.

Indicator if a variant is visible for all users.

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

setLabelReadOnly

Sets a new value for property labelReadOnly.

Indicates if the variant title can be changed.

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

Default value is false.

setLifecyclePackage

Sets a new value for property lifecyclePackage.

ABAP package the variant is assigned to. Used for transport functionality.

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

setLifecycleTransportId

Sets a new value for property lifecycleTransportId.

Identifier of the transport object the variant is assigned to.

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

setNamespace

Sets a new value for property namespace.

Variant namespace

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

setReadOnly

Sets a new value for property readOnly.

If set to false, the user is allowed to change the item's data

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

Default value is false.

setText

Setter for text property.

attachChange

Attaches event handler fnFunction to the change event of this sap.ui.comp.variants.VariantItem.

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.ui.comp.variants.VariantItem itself.

This event is fired when one of the properties is changed.

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.ui.comp.variants.VariantItem itself

detachChange

Detaches event handler fnFunction from the change event of this sap.ui.comp.variants.VariantItem.

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.ui.comp.variants.VariantItem.extend

Creates a new subclass of class sap.ui.comp.variants.VariantItem 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.Item.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

fireChange

Fires event change to attached listeners.

Param Type DefaultValue Description
mParameters object

Parameters to pass along with the event

propertyName string

Name of the changed property

getAccessOptions

Gets current value of property accessOptions.

Flags for a variant to indicate why it might be read-only.

Since 1.28.0 Replaced by property <code>labelReadOnly</code>

getAuthor

Gets current value of property author.

Author of the variant

getExecuteOnSelection

Gets current value of property executeOnSelection.

Attribute for usage in SmartFilterBar

Default value is false.

getFavorite

Gets current value of property favorite.

Indicates if favorites can be created.

Default value is false.

getGlobal

Gets current value of property global.

Indicator if a variant is visible for all users.

getLabelReadOnly

Gets current value of property labelReadOnly.

Indicates if the variant title can be changed.

Default value is false.

getLifecyclePackage

Gets current value of property lifecyclePackage.

ABAP package the variant is assigned to. Used for transport functionality.

getLifecycleTransportId

Gets current value of property lifecycleTransportId.

Identifier of the transport object the variant is assigned to.

sap.ui.comp.variants.VariantItem.getMetadata

Returns a metadata object for class sap.ui.comp.variants.VariantItem.

getNamespace

Gets current value of property namespace.

Variant namespace

getReadOnly

Gets current value of property readOnly.

If set to false, the user is allowed to change the item's data

Default value is false.

setAccessOptions

Sets a new value for property accessOptions.

Flags for a variant to indicate why it might be read-only.

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

Since 1.28.0 Replaced by property <code>labelReadOnly</code>
Param Type DefaultValue Description
sAccessOptions string

New value for property accessOptions

setAuthor

Sets a new value for property author.

Author of the variant

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

Param Type DefaultValue Description
sAuthor string

New value for property author

setExecuteOnSelection

Sets a new value for property executeOnSelection.

Attribute for usage in SmartFilterBar

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

Default value is false.

Param Type DefaultValue Description
bExecuteOnSelection boolean false

New value for property executeOnSelection

setFavorite

Sets a new value for property favorite.

Indicates if favorites can be created.

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

Default value is false.

Param Type DefaultValue Description
bFavorite boolean false

New value for property favorite

setGlobal

Sets a new value for property global.

Indicator if a variant is visible for all users.

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

Param Type DefaultValue Description
bGlobal boolean

New value for property global

setLabelReadOnly

Sets a new value for property labelReadOnly.

Indicates if the variant title can be changed.

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

Default value is false.

Param Type DefaultValue Description
bLabelReadOnly boolean false

New value for property labelReadOnly

setLifecyclePackage

Sets a new value for property lifecyclePackage.

ABAP package the variant is assigned to. Used for transport functionality.

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

Param Type DefaultValue Description
sLifecyclePackage string

New value for property lifecyclePackage

setLifecycleTransportId

Sets a new value for property lifecycleTransportId.

Identifier of the transport object the variant is assigned to.

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

Param Type DefaultValue Description
sLifecycleTransportId string

New value for property lifecycleTransportId

setNamespace

Sets a new value for property namespace.

Variant namespace

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

Param Type DefaultValue Description
sNamespace string

New value for property namespace

setReadOnly

Sets a new value for property readOnly.

If set to false, the user is allowed to change the item's data

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

Default value is false.

Param Type DefaultValue Description
bReadOnly boolean false

New value for property readOnly

setText

Setter for text property.

Param Type DefaultValue Description
sText string

New text