Class sap.ui.commons.RatingIndicatorModule: sap/ui/commons/RatingIndicator

extends Control

RatingIndicator is used to let the user do some rating on a given topic. The amount of rating symbols can be specified, as well as the URIs to the image icons which shall be used as rating symbols. When the user performs a rating, an event is fired.
Deprecated API:
Since version 1.38. Instead, use the sap.m.RatingIndicator control.
Constructor Summary
new sap.ui.commons.RatingIndicator(sId?, mSettings?)Constructor for a new RatingIndicator.
Event Summary
change(oControlEvent)The event is fired when the user has done a rating.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.commons.RatingIndicator.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.commons.RatingIndicator with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.commons.RatingIndicator.getMetadata()Returns a metadata object for class sap.ui.commons.RatingIndicator.
addAriaDescribedBy(vAriaDescribedBy)Adds some ariaDescribedBy into the association ariaDescribedBy.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the change event of this sap.ui.commons.RatingIndicator.
bindValue(oBindingInfo)Binds property value to model data.
detachChange(fnFunction, oListener)Detaches event handler fnFunction from the change event of this sap.ui.commons.RatingIndicator.
fireChange(mParameters?)Fires event change 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.
getAverageValue()Gets current value of property averageValue.
getEditable()Gets current value of property editable.
getIconHovered()Gets current value of property iconHovered.
getIconSelected()Gets current value of property iconSelected.
getIconUnselected()Gets current value of property iconUnselected.
getMaxValue()Gets current value of property maxValue.
getValue()Gets current value of property value.
getVisualMode()Gets current value of property visualMode.
removeAllAriaDescribedBy()Removes all the controls in the association named ariaDescribedBy.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaDescribedBy(vAriaDescribedBy)Removes an ariaDescribedBy from the association named ariaDescribedBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setAverageValue(fAverageValue)Sets a new value for property averageValue.
setEditable(bEditable)Sets a new value for property editable.
setIconHovered(sIconHovered)Sets a new value for property iconHovered.
setIconSelected(sIconSelected)Sets a new value for property iconSelected.
setIconUnselected(sIconUnselected)Sets a new value for property iconUnselected.
setMaxValue(iMaxValue)Setter for property maxValue.
setValue(fValue)Sets a new value for property value.
setVisualMode(sVisualMode)Sets a new value for property visualMode.
unbindValue()Unbinds property value from model data.
Constructor Detail
new sap.ui.commons.RatingIndicator(sId?, mSettings?)

Constructor for a new RatingIndicator.

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:

In addition, all settings applicable to the base type sap.ui.core.Control can be used as well.

Parameters:
stringsId?ID for the new control, generated automatically if no ID is given
objectmSettings?Initial settings for the new control
Event Detail
change(oControlEvent)
The event is fired when the user has done a rating.
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
intoControlEvent.getParameters.valueThe value of the user rating
Method Detail
sap.ui.commons.RatingIndicator.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.commons.RatingIndicator 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:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.commons.RatingIndicator.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.commons.RatingIndicator.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.ui.commons.RatingIndicator
Adds some ariaDescribedBy into the association ariaDescribedBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedBythe ariaDescribedBy to add; if empty, nothing is inserted
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.ui.commons.RatingIndicator
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledBythe ariaLabelledBy to add; if empty, nothing is inserted
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
attachChange(oData?, fnFunction, oListener?): sap.ui.commons.RatingIndicator

Attaches event handler fnFunction to the change event of this sap.ui.commons.RatingIndicator.

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.commons.RatingIndicator itself.

The event is fired when the user has done a rating.

Parameters:
objectoData?An application-specific payload object that will be passed to the event handler along with the event object when firing the event
functionfnFunctionThe function to be called when the event occurs
objectoListener?Context object to call the event handler with. Defaults to this sap.ui.commons.RatingIndicator itself
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
bindValue(oBindingInfo): sap.ui.commons.RatingIndicator

Binds property value to model data.

See ManagedObject.bindProperty for a detailed description of the possible properties of oBindingInfo

Parameters:
objectoBindingInfoThe binding information
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
detachChange(fnFunction, oListener): sap.ui.commons.RatingIndicator

Detaches event handler fnFunction from the change event of this sap.ui.commons.RatingIndicator.

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

Parameters:
functionfnFunctionThe function to be called, when the event occurs
objectoListenerContext object on which the given function had to be called
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
fireChange(mParameters?): sap.ui.commons.RatingIndicator
Fires event change to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
intmParameters.value?The value of the user rating
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
getAccessibilityInfo()
See:
sap.ui.core.Control#getAccessibilityInfo
getAriaDescribedBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns:
sap.ui.core.ID[]
getAriaLabelledBy(): sap.ui.core.ID[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Returns:
sap.ui.core.ID[]
getAverageValue(): float

Gets current value of property averageValue.

Determines the average value. This value is shown if no value is set. This can be used to display an average Value before the user votes.

Default value is 0.

Returns:
floatValue of property averageValue
getEditable(): boolean

Gets current value of property editable.

Determines if the rating symbols can be edited.

Default value is true.

Returns:
booleanValue of property editable
getIconHovered(): sap.ui.core.URI

Gets current value of property iconHovered.

The URI to the image which is displayed when the mouse hovers onto a rating symbol. If used, a requirement is that all custom icons need to have the same size. Note that when this attribute is used also the other icon attributes need to be set.

Returns:
sap.ui.core.URIValue of property iconHovered
getIconSelected(): sap.ui.core.URI

Gets current value of property iconSelected.

The URI to the image which shall be displayed for all selected rating symbols. Note that when this attribute is used, also the other icon attributes need to be set.

Returns:
sap.ui.core.URIValue of property iconSelected
getIconUnselected(): sap.ui.core.URI

Gets current value of property iconUnselected.

The URI to the image which shall be displayed for all unselected rating symbols. If this attribute is used, a requirement is that all custom icons need to have the same size. Note that when this attribute is used also the other icon attributes need to be set.

Returns:
sap.ui.core.URIValue of property iconUnselected
getMaxValue(): int

Gets current value of property maxValue.

Determines the number of displayed rating symbols

Default value is 5.

Returns:
intValue of property maxValue
getValue(): float

Gets current value of property value.

Determines the currently selected value. If value is set to sap.ui.commons.RatingIndicator.NoValue, the averageValue is shown.

Default value is 0.

Returns:
floatValue of property value

Gets current value of property visualMode.

Defines how float values are visualized: Full, Half, Continuous (see enumeration RatingIndicatorVisualMode)

Default value is Half.

Returns:
sap.ui.commons.RatingIndicatorVisualModeValue of property visualMode
removeAllAriaDescribedBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaDescribedBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAllAriaLabelledBy(): sap.ui.core.ID[]
Removes all the controls in the association named ariaLabelledBy.
Returns:
sap.ui.core.ID[]An array of the removed elements (might be empty)
removeAriaDescribedBy(vAriaDescribedBy): sap.ui.core.ID
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaDescribedByThe ariaDescribedBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaDescribedBy or null
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.ID
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
int|sap.ui.core.ID|sap.ui.core.ControlvAriaLabelledByThe ariaLabelledBy to be removed or its index or ID
Returns:
sap.ui.core.IDThe removed ariaLabelledBy or null
setAverageValue(fAverageValue): sap.ui.commons.RatingIndicator

Sets a new value for property averageValue.

Determines the average value. This value is shown if no value is set. This can be used to display an average Value before the user votes.

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

Default value is 0.

Parameters:
floatfAverageValueNew value for property averageValue
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setEditable(bEditable): sap.ui.commons.RatingIndicator

Sets a new value for property editable.

Determines if the rating symbols can be edited.

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

Default value is true.

Parameters:
booleanbEditableNew value for property editable
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setIconHovered(sIconHovered): sap.ui.commons.RatingIndicator

Sets a new value for property iconHovered.

The URI to the image which is displayed when the mouse hovers onto a rating symbol. If used, a requirement is that all custom icons need to have the same size. Note that when this attribute is used also the other icon attributes need to be set.

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

Parameters:
sap.ui.core.URIsIconHoveredNew value for property iconHovered
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setIconSelected(sIconSelected): sap.ui.commons.RatingIndicator

Sets a new value for property iconSelected.

The URI to the image which shall be displayed for all selected rating symbols. Note that when this attribute is used, also the other icon attributes need to be set.

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

Parameters:
sap.ui.core.URIsIconSelectedNew value for property iconSelected
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setIconUnselected(sIconUnselected): sap.ui.commons.RatingIndicator

Sets a new value for property iconUnselected.

The URI to the image which shall be displayed for all unselected rating symbols. If this attribute is used, a requirement is that all custom icons need to have the same size. Note that when this attribute is used also the other icon attributes need to be set.

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

Parameters:
sap.ui.core.URIsIconUnselectedNew value for property iconUnselected
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setMaxValue(iMaxValue): sap.ui.commons.RatingIndicator

Setter for property maxValue.

Default value is 5 Minimum value is 1

Parameters:
intiMaxValuenew value for property maxValue
Returns:
sap.ui.commons.RatingIndicatorthis to allow method chaining

Sets a new value for property value.

Determines the currently selected value. If value is set to sap.ui.commons.RatingIndicator.NoValue, the averageValue is shown.

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

Default value is 0.

Parameters:
floatfValueNew value for property value
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
setVisualMode(sVisualMode): sap.ui.commons.RatingIndicator

Sets a new value for property visualMode.

Defines how float values are visualized: Full, Half, Continuous (see enumeration RatingIndicatorVisualMode)

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

Default value is Half.

Parameters:
sap.ui.commons.RatingIndicatorVisualModesVisualModeNew value for property visualMode
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining
Unbinds property value from model data.
Returns:
sap.ui.commons.RatingIndicatorReference to this in order to allow method chaining