The VariantItem class describes a variant item.
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 |
Name | Type | Default Value | Description |
---|---|---|---|
_contexts | object | empty object | Assigned contexts. |
accessOptions | string | Flags for a variant to indicate why it might be read-only. |
|
author | string | Author of the variant |
|
executeOnSelection | boolean | false | Attribute for usage in |
favorite | boolean | false | Indicates if favorites can be created. |
global | boolean | Indicator if a variant is visible for all users. |
|
labelReadOnly | boolean | false | Indicates if the variant title can be changed. |
lifecyclePackage | string | ABAP package the variant is assigned to. Used for transport functionality. |
|
lifecycleTransportId | string | Identifier of the transport object the variant is assigned to. |
|
namespace | string | Variant namespace |
|
readOnly | boolean | false | If set to |
Method | Description |
---|---|
attachChange |
Attaches event handler When called, the context of the event handler (its This event is fired when one of the properties is changed. |
detachChange |
Detaches event handler 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
|
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 Default value is |
getFavorite |
Gets current value of property favorite. Indicates if favorites can be created. Default value is |
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 |
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 Default value is |
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
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 |
setExecuteOnSelection |
Sets a new value for property executeOnSelection. Attribute for usage in When called with a value of Default value is |
setFavorite |
Sets a new value for property favorite. Indicates if favorites can be created. When called with a value of Default value is |
setGlobal |
Sets a new value for property global. Indicator if a variant is visible for all users. When called with a value of |
setLabelReadOnly |
Sets a new value for property labelReadOnly. Indicates if the variant title can be changed. When called with a value of Default value is |
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 |
setLifecycleTransportId |
Sets a new value for property lifecycleTransportId. Identifier of the transport object the variant is assigned to. When called with a value of |
setNamespace |
Sets a new value for property namespace. Variant namespace When called with a value of |
setReadOnly |
Sets a new value for property readOnly. If set to When called with a value of Default value is |
setText |
Setter for text property. |
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 |
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 |
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 |
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 |
Gets current value of property accessOptions.
Flags for a variant to indicate why it might be read-only.
Gets current value of property executeOnSelection.
Attribute for usage in SmartFilterBar
Default value is false
.
Gets current value of property favorite.
Indicates if favorites can be created.
Default value is false
.
Gets current value of property labelReadOnly.
Indicates if the variant title can be changed.
Default value is false
.
Gets current value of property lifecyclePackage.
ABAP package the variant is assigned to. Used for transport functionality.
Gets current value of property lifecycleTransportId.
Identifier of the transport object the variant is assigned to.
Returns a metadata object for class sap.ui.comp.variants.VariantItem.
Gets current value of property readOnly.
If set to false
, the user is allowed to change the item's data
Default value is false
.
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.
Param | Type | DefaultValue | Description |
---|---|---|---|
sAccessOptions | string |
New value for property |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |
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 |