Class sap.suite.ui.commons.ComparisonDataModule: sap/suite/ui/commons/ComparisonData

extends Element

Comparison tile value holder.

Deprecated API:Since version 1.34. Deprecated. sap.suite.ui.microchart.ComparisonMicroChartData should be used.

Constructor Summary
new sap.suite.ui.commons.ComparisonData(sId?, mSettings?)Constructor for a new ComparisonData.
Event Summary
press(oControlEvent)The event is fired when the user chooses the comparison data.
Method Summary
sap.suite.ui.commons.ComparisonData.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.suite.ui.commons.ComparisonData with name sClassName and enriches it with the information contained in oClassInfo.
sap.suite.ui.commons.ComparisonData.getMetadata()Returns a metadata object for class sap.suite.ui.commons.ComparisonData.
attachPress(oData?, fnFunction, oListener?)Attach event handler fnFunction to the 'press' event of this sap.suite.ui.commons.ComparisonData.
detachPress(fnFunction, oListener)Detach event handler fnFunction from the 'press' event of this sap.suite.ui.commons.ComparisonData.
firePress(mArguments?)Fire event press to attached listeners.
getColor()Getter for property color.
getDisplayValue()Getter for property displayValue.
getTitle()Getter for property title.
getValue()Getter for property value.
setColor(oColor)Setter for property color.
setDisplayValue(sDisplayValue)Setter for property displayValue.
setTitle(sTitle)Setter for property title.
setValue(fValue)Setter for property value.
Constructor Detail
new sap.suite.ui.commons.ComparisonData(sId?, mSettings?)
Constructor for a new ComparisonData.

Accepts an object literal mSettings that defines initial property values, aggregated and associated objects as well as event handlers.

If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).

The supported settings are:

  • Properties
    • title : string
    • value : float (default: 0)
    • color : sap.suite.ui.commons.InfoTileValueColor (default: sap.suite.ui.commons.InfoTileValueColor.Neutral)
    • displayValue : string
  • Aggregations
    • Associations
      • Events
        • press : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

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

      Parameters:
      {string}sId? id for the new control, generated automatically if no id is given
      {object}mSettings? initial settings for the new control
      Deprecated:
      Since version 1.34. Deprecated. sap.suite.ui.microchart.ComparisonMicroChartData should be used.
      Event Detail
      press(oControlEvent)
      The event is fired when the user chooses the comparison data.
      Parameters:
      {sap.ui.base.Event}oControlEvent
      {sap.ui.base.EventProvider}oControlEvent.getSource
      {object}oControlEvent.getParameters
      Since:
      1.30
      Method Detail
      sap.suite.ui.commons.ComparisonData.extend(sClassName, oClassInfo?, FNMetaImpl?): function
      Creates a new subclass of class sap.suite.ui.commons.ComparisonData with name sClassName and enriches it with the information contained in oClassInfo.

      oClassInfo might contain the same kind of informations as described in Element.extend.

      Parameters:
      {string}sClassName name of the class to be created
      {object}oClassInfo? object literal with informations about the class
      {function}FNMetaImpl? constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata.
      Returns:
      {function} the created class / constructor function
      sap.suite.ui.commons.ComparisonData.getMetadata(): sap.ui.base.Metadata
      Returns a metadata object for class sap.suite.ui.commons.ComparisonData.
      Returns:
      {sap.ui.base.Metadata} Metadata object describing this class
      attachPress(oData?, fnFunction, oListener?): sap.suite.ui.commons.ComparisonData
      Attach event handler fnFunction to the 'press' event of this sap.suite.ui.commons.ComparisonData.
      . When called, the context of the event handler (its this) will be bound to oListener if specified otherwise to this sap.suite.ui.commons.ComparisonData.
      itself.

      The event is fired when the user chooses the comparison data.

      Parameters:
      {object}oData? An application specific payload object, that will be passed to the event handler along with the event object when firing the event.
      {function}fnFunction The function to call, when the event occurs.
      {object}oListener? Context object to call the event handler with. Defaults to this sap.suite.ui.commons.ComparisonData.
      itself.
      Since:
      1.30
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      detachPress(fnFunction, oListener): sap.suite.ui.commons.ComparisonData
      Detach event handler fnFunction from the 'press' event of this sap.suite.ui.commons.ComparisonData.

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

      Parameters:
      {function}fnFunction The function to call, when the event occurs.
      {object}oListener Context object on which the given function had to be called.
      Since:
      1.30
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      firePress(mArguments?): sap.suite.ui.commons.ComparisonData
      Fire event press to attached listeners.
      Parameters:
      {Map}mArguments? the arguments to pass along with the event.
      Since:
      1.30
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      Getter for property color. The semantic color of the value.

      Default value is Neutral

      Returns:
      {sap.suite.ui.commons.InfoTileValueColor} the value of property color
      getDisplayValue(): string
      Getter for property displayValue. If this property is set then it will be rendered instead of value.

      Default value is empty/undefined

      Since:
      1.22
      Returns:
      {string} the value of property displayValue
      getTitle(): string
      Getter for property title. The comparison bar title.

      Default value is empty/undefined

      Returns:
      {string} the value of property title
      getValue(): float
      Getter for property value. The float value for comparison.

      Default value is 0

      Returns:
      {float} the value of property value
      Setter for property color.

      Default value is Neutral

      Parameters:
      {sap.suite.ui.commons.InfoTileValueColor}oColor new value for property color
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      setDisplayValue(sDisplayValue): sap.suite.ui.commons.ComparisonData
      Setter for property displayValue.

      Default value is empty/undefined

      Parameters:
      {string}sDisplayValue new value for property displayValue
      Since:
      1.22
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      Setter for property title.

      Default value is empty/undefined

      Parameters:
      {string}sTitle new value for property title
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining
      Setter for property value.

      Default value is 0

      Parameters:
      {float}fValue new value for property value
      Returns:
      {sap.suite.ui.commons.ComparisonData}this to allow method chaining