class sap.ui.comp.state.UIState

Control sample: sap.ui.comp.state.UIState
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Module: sap/ui/comp/state/UIState
Application Component: CA-UI5-CMP

Creates a new instance of an UIState class.


Constructor

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.state.UIState(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
presentationVariant object

Object representing the presentation variant. The structure looks like:


{
	ContextUrl: {string},
	MaxItems: {int},
 SortOrder: [],
	GroupBy: [],
	Total: [],
	RequestAtLeast: [],
	Visualizations: []
}

Note:

  • PresentationVariantID property is not provided
  • Text property is not provided because it is translated text
  • TotalBy is not supported yet
  • IncludeGrandTotal is not supported yet
  • InitialExpansionLevel is not supported yet
  • Title of Visualizations.Content property is not provided because it is translated text
  • Description of Visualizations.Content property is not provided because it is translated text
  • VariantName property is not part of specified DataSuiteFormat yet

Visibility: public
selectionVariant object

Object representing the selection variant. The structure looks like:


{
 SelectionVariant: {
     SelectionVariantID: {string},
		Parameters: [],
		SelectOptions: []
}

Visibility: public
semanticDates object

Structure containing Date range semantic data of the filter value.


{
	Dates: [
		{
			PropertyName: string,
			Data: {
					calendarType: string,
					key: string,
					operation: string,
					value1: int,
					value2: int
				}
		}
	]
}

Visibility: public
valueTexts object

Structure containing filter value keys and its corresponding descriptions.


{
	Texts: [
		{
			Language: string,
			ContextUrl: string,
			PropertyTexts: [
				{
					PropertyName: string,
					ValueTexts: [
						{
							PropertyValue: string,
							Text: string
						}
					]
				}
			]
		}
	]
}

Visibility: public
variantName string

Variant name.

Visibility: public

Methods Overview

Method Description
sap.ui.comp.state.UIState.calcSemanticDates

Constructs the value state out of a given selection variant and the current model data

sap.ui.comp.state.UIState.calculateValueTexts

Constructs the value state out of a given selection variant and the current model data

sap.ui.comp.state.UIState.createFromSelectionAndPresentationVariantAnnotation

Converts PresentationVariant annotation to UIState object.

sap.ui.comp.state.UIState.determineFiltersWithOnlyKeyValues

Determines the filter names with value keys where the description is not available.

sap.ui.comp.state.UIState.enrichWithSemanticDates

Enriches the internal filter bar value format with the information from the value state.

sap.ui.comp.state.UIState.enrichWithValueTexts

Enriches the internal filter bar value format with the information from the value state.

sap.ui.comp.state.UIState.extend

Creates a new subclass of class sap.ui.comp.state.UIState 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.base.ManagedObject.extend.

sap.ui.comp.state.UIState.getMetadata

Returns a metadata object for class sap.ui.comp.state.UIState.

getPresentationVariant

Gets current value of property presentationVariant.

Object representing the presentation variant. The structure looks like:


{
	ContextUrl: {string},
	MaxItems: {int},
 SortOrder: [],
	GroupBy: [],
	Total: [],
	RequestAtLeast: [],
	Visualizations: []
}

Note:

  • PresentationVariantID property is not provided
  • Text property is not provided because it is translated text
  • TotalBy is not supported yet
  • IncludeGrandTotal is not supported yet
  • InitialExpansionLevel is not supported yet
  • Title of Visualizations.Content property is not provided because it is translated text
  • Description of Visualizations.Content property is not provided because it is translated text
  • VariantName property is not part of specified DataSuiteFormat yet

getSelectionVariant

Gets current value of property selectionVariant.

Object representing the selection variant. The structure looks like:


{
 SelectionVariant: {
     SelectionVariantID: {string},
		Parameters: [],
		SelectOptions: []
}

getSemanticDates

Gets current value of property semanticDates.

Structure containing Date range semantic data of the filter value.


{
	Dates: [
		{
			PropertyName: string,
			Data: {
					calendarType: string,
					key: string,
					operation: string,
					value1: int,
					value2: int
				}
		}
	]
}

getValueTexts

Gets current value of property valueTexts.

Structure containing filter value keys and its corresponding descriptions.


{
	Texts: [
		{
			Language: string,
			ContextUrl: string,
			PropertyTexts: [
				{
					PropertyName: string,
					ValueTexts: [
						{
							PropertyValue: string,
							Text: string
						}
					]
				}
			]
		}
	]
}

getVariantName

Gets current value of property variantName.

Variant name.

setPresentationVariant

Sets a new value for property presentationVariant.

Object representing the presentation variant. The structure looks like:


{
	ContextUrl: {string},
	MaxItems: {int},
 SortOrder: [],
	GroupBy: [],
	Total: [],
	RequestAtLeast: [],
	Visualizations: []
}

Note:

  • PresentationVariantID property is not provided
  • Text property is not provided because it is translated text
  • TotalBy is not supported yet
  • IncludeGrandTotal is not supported yet
  • InitialExpansionLevel is not supported yet
  • Title of Visualizations.Content property is not provided because it is translated text
  • Description of Visualizations.Content property is not provided because it is translated text
  • VariantName property is not part of specified DataSuiteFormat yet

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

setSelectionVariant

Sets a new value for property selectionVariant.

Object representing the selection variant. The structure looks like:


{
 SelectionVariant: {
     SelectionVariantID: {string},
		Parameters: [],
		SelectOptions: []
}

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

setSemanticDates

Sets a new value for property semanticDates.

Structure containing Date range semantic data of the filter value.


{
	Dates: [
		{
			PropertyName: string,
			Data: {
					calendarType: string,
					key: string,
					operation: string,
					value1: int,
					value2: int
				}
		}
	]
}

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

setValueTexts

Sets a new value for property valueTexts.

Structure containing filter value keys and its corresponding descriptions.


{
	Texts: [
		{
			Language: string,
			ContextUrl: string,
			PropertyTexts: [
				{
					PropertyName: string,
					ValueTexts: [
						{
							PropertyValue: string,
							Text: string
						}
					]
				}
			]
		}
	]
}

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

setVariantName

Sets a new value for property variantName.

Variant name.

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

sap.ui.comp.state.UIState.calcSemanticDates

Constructs the value state out of a given selection variant and the current model data

Param Type DefaultValue Description
oSelectionVariant object

selection variant object

mData Object<string,any>

the filter provider model data

sap.ui.comp.state.UIState.calculateValueTexts

Constructs the value state out of a given selection variant and the current model data

Param Type DefaultValue Description
oSelectionVariant object

selection variant object

mData Object<string,any>

the filter provider model data

sap.ui.comp.state.UIState.createFromSelectionAndPresentationVariantAnnotation

Converts PresentationVariant annotation to UIState object.

Param Type DefaultValue Description
sVariantName string

Name of the variant

oSelectionVariantAnnotation object

Object representing the com.sap.vocabularies.UI.v1.SelectionVariant annotation provided by MetadataAnalyser

oPresentationVariantAnnotation object

Object representing the com.sap.vocabularies.UI.v1.PresentationVariant annotation provided by MetadataAnalyser

sap.ui.comp.state.UIState.determineFiltersWithOnlyKeyValues

Determines the filter names with value keys where the description is not available.

Param Type DefaultValue Description
oValueTexts object

Containing the value description for filters

oSelectionVariant object

The selection variant containing filters and value keys

aIgnoreSelOptionName array

Filter names to ignore

sap.ui.comp.state.UIState.enrichWithSemanticDates

Enriches the internal filter bar value format with the information from the value state.

Param Type DefaultValue Description
sPayload string

the filter bar inner data format

oValueTexts object

the value texts format containing the eventual descriptions.

sap.ui.comp.state.UIState.enrichWithValueTexts

Enriches the internal filter bar value format with the information from the value state.

Param Type DefaultValue Description
sPayload string

the filter bar inner data format

oValueTexts object

the value texts format containing the eventual descriptions.

sap.ui.comp.state.UIState.extend

Creates a new subclass of class sap.ui.comp.state.UIState 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.base.ManagedObject.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

sap.ui.comp.state.UIState.getMetadata

Returns a metadata object for class sap.ui.comp.state.UIState.

getPresentationVariant

Gets current value of property presentationVariant.

Object representing the presentation variant. The structure looks like:


{
	ContextUrl: {string},
	MaxItems: {int},
 SortOrder: [],
	GroupBy: [],
	Total: [],
	RequestAtLeast: [],
	Visualizations: []
}

Note:

getSelectionVariant

Gets current value of property selectionVariant.

Object representing the selection variant. The structure looks like:


{
 SelectionVariant: {
     SelectionVariantID: {string},
		Parameters: [],
		SelectOptions: []
}

getSemanticDates

Gets current value of property semanticDates.

Structure containing Date range semantic data of the filter value.


{
	Dates: [
		{
			PropertyName: string,
			Data: {
					calendarType: string,
					key: string,
					operation: string,
					value1: int,
					value2: int
				}
		}
	]
}

getValueTexts

Gets current value of property valueTexts.

Structure containing filter value keys and its corresponding descriptions.


{
	Texts: [
		{
			Language: string,
			ContextUrl: string,
			PropertyTexts: [
				{
					PropertyName: string,
					ValueTexts: [
						{
							PropertyValue: string,
							Text: string
						}
					]
				}
			]
		}
	]
}

getVariantName

Gets current value of property variantName.

Variant name.

setPresentationVariant

Sets a new value for property presentationVariant.

Object representing the presentation variant. The structure looks like:


{
	ContextUrl: {string},
	MaxItems: {int},
 SortOrder: [],
	GroupBy: [],
	Total: [],
	RequestAtLeast: [],
	Visualizations: []
}

Note:

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

Param Type DefaultValue Description
oPresentationVariant object

New value for property presentationVariant

setSelectionVariant

Sets a new value for property selectionVariant.

Object representing the selection variant. The structure looks like:


{
 SelectionVariant: {
     SelectionVariantID: {string},
		Parameters: [],
		SelectOptions: []
}

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

Param Type DefaultValue Description
oSelectionVariant object

New value for property selectionVariant

setSemanticDates

Sets a new value for property semanticDates.

Structure containing Date range semantic data of the filter value.


{
	Dates: [
		{
			PropertyName: string,
			Data: {
					calendarType: string,
					key: string,
					operation: string,
					value1: int,
					value2: int
				}
		}
	]
}

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

Param Type DefaultValue Description
oSemanticDates object

New value for property semanticDates

setValueTexts

Sets a new value for property valueTexts.

Structure containing filter value keys and its corresponding descriptions.


{
	Texts: [
		{
			Language: string,
			ContextUrl: string,
			PropertyTexts: [
				{
					PropertyName: string,
					ValueTexts: [
						{
							PropertyValue: string,
							Text: string
						}
					]
				}
			]
		}
	]
}

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

Param Type DefaultValue Description
oValueTexts object

New value for property valueTexts

setVariantName

Sets a new value for property variantName.

Variant name.

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

Param Type DefaultValue Description
sVariantName string

New value for property variantName