Class sap.m.SliderModule: sap/m/Slider

extends Control
known direct subclasses: RangeSlider

A slider is a user interface control that enables the user to adjust values in a specified numerical range.

Constructor Summary
new sap.m.Slider(sId?, mSettings?)Constructor for a new sap.m.Slider.
Event Summary
change(oControlEvent)This event is triggered after the end user finishes interacting, if there is any change.
liveChange(oControlEvent)This event is triggered during the dragging period, each time the slider value changes.
Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.Slider.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.Slider with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.Slider.getMetadata()Returns a metadata object for class sap.m.Slider.
addAriaLabelledBy(vAriaLabelledBy)Adds some ariaLabelledBy into the association ariaLabelledBy.
attachChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the change event of this sap.m.Slider.
attachLiveChange(oData?, fnFunction, oListener?)Attaches event handler fnFunction to the liveChange event of this sap.m.Slider.
detachChange(fnFunction, oListener)Detaches event handler fnFunction from the change event of this sap.m.Slider.
detachLiveChange(fnFunction, oListener)Detaches event handler fnFunction from the liveChange event of this sap.m.Slider.
fireChange(mArguments?)Fires event change to attached listeners.
fireLiveChange(mArguments?)Fires event liveChange to attached listeners.
getAriaLabelledBy()Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
getEnabled()Gets current value of property enabled.
getMax()Gets current value of property max.
getMin()Gets current value of property min.
getName()Gets current value of property name.
getProgress()Gets current value of property progress.
getShowHandleTooltip()Gets current value of property showHandleTooltip.
getStep()Gets current value of property step.
getValue()Gets current value of property value.
getWidth()Gets current value of property width.
removeAllAriaLabelledBy()Removes all the controls in the association named ariaLabelledBy.
removeAriaLabelledBy(vAriaLabelledBy)Removes an ariaLabelledBy from the association named ariaLabelledBy.
setEnabled(bEnabled)Sets a new value for property enabled.
setMax(fMax)Sets a new value for property max.
setMin(fMin)Sets a new value for property min.
setName(sName)Sets a new value for property name.
setProgress(bProgress)Sets a new value for property progress.
setShowHandleTooltip(bShowHandleTooltip)Sets a new value for property showHandleTooltip.
setStep(fStep)Sets a new value for property step.
setValue(fNewValue)Sets the property value.
setWidth(sWidth)Sets a new value for property width.
stepDown(iStep?)Decrements the value by multiplying the step the step with the given parameter.
stepUp(iStep?)Increments the value by multiplying the step with the given parameter.
Constructor Detail
new sap.m.Slider(sId?, mSettings?)
Constructor for a new sap.m.Slider.

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:

  • Properties
  • Events
    • change : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
    • liveChange : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]

In addition, all settings applicable to the base type sap.ui.core.Control 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.
Event Detail
change(oControlEvent)
This event is triggered after the end user finishes interacting, if there is any change.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{float}oControlEvent.getParameters.value The current value of the slider after a change.
liveChange(oControlEvent)
This event is triggered during the dragging period, each time the slider value changes.
Parameters:
{sap.ui.base.Event}oControlEvent
{sap.ui.base.EventProvider}oControlEvent.getSource
{object}oControlEvent.getParameters
{float}oControlEvent.getParameters.value The current value of the slider after a live change.
Method Detail
sap.m.Slider.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.m.Slider 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:
{string}sClassName Name of the class being created
{object}oClassInfo? Object literal with information about the class
{function}FNMetaImpl? Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
{function} Created class / constructor function
sap.m.Slider.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.Slider.
Returns:
{sap.ui.base.Metadata} Metadata object describing this class
addAriaLabelledBy(vAriaLabelledBy): sap.m.Slider
Adds some ariaLabelledBy into the association ariaLabelledBy.
Parameters:
{string|sap.ui.core.Control}vAriaLabelledBy the ariaLabelledBy to add; if empty, nothing is inserted
Since:
1.27.0
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
attachChange(oData?, fnFunction, oListener?): sap.m.Slider
Attaches event handler fnFunction to the change event of this sap.m.Slider.

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.m.Slider itself.

This event is triggered after the end user finishes interacting, if there is any change.

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 be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.Slider itself
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
attachLiveChange(oData?, fnFunction, oListener?): sap.m.Slider
Attaches event handler fnFunction to the liveChange event of this sap.m.Slider.

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.m.Slider itself.

This event is triggered during the dragging period, each time the slider value changes.

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 be called when the event occurs
{object}oListener? Context object to call the event handler with. Defaults to this sap.m.Slider itself
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
detachChange(fnFunction, oListener): sap.m.Slider
Detaches event handler fnFunction from the change event of this sap.m.Slider.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
detachLiveChange(fnFunction, oListener): sap.m.Slider
Detaches event handler fnFunction from the liveChange event of this sap.m.Slider.

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

Parameters:
{function}fnFunction The function to be called, when the event occurs
{object}oListener Context object on which the given function had to be called
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
fireChange(mArguments?): sap.m.Slider
Fires event change to attached listeners.

Expects the following event parameters:

  • value of type floatThe current value of the slider after a change.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
fireLiveChange(mArguments?): sap.m.Slider
Fires event liveChange to attached listeners.

Expects the following event parameters:

  • value of type floatThe current value of the slider after a live change.
Parameters:
{Map}mArguments? The arguments to pass along with the event
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
getAriaLabelledBy(): sap.ui.core.Control[]
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Since:
1.27.0
Returns:
{sap.ui.core.Control[]}
getEnabled(): boolean
Gets current value of property enabled.

Indicates whether the user can change the value.

Default value is true.

Returns:
{boolean} Value of property enabled
getMax(): float
Gets current value of property max.

The maximum value.

Default value is 100.

Returns:
{float} Value of property max
getMin(): float
Gets current value of property min.

The minimum value.

Default value is 0.

Returns:
{float} Value of property min
getName(): string
Gets current value of property name.

The name property to be used in the HTML code for the slider (e.g. for HTML forms that send data to the server via submit).

Default value is .

Returns:
{string} Value of property name
getProgress(): boolean
Gets current value of property progress.

Indicate whether a progress bar indicator is shown.

Default value is true.

Returns:
{boolean} Value of property progress
getShowHandleTooltip(): boolean
Gets current value of property showHandleTooltip.

Indicate whether the handle tooltip is shown.

Default value is true.

Since:
1.31
Returns:
{boolean} Value of property showHandleTooltip
getStep(): float
Gets current value of property step.

Define the amount of units to change the slider when adjusting by drag and drop.

Defines the size of the slider's selection intervals. (e.g. min = 0, max = 10, step = 5 would result in possible selection of the values 0, 5, 10).

The step must be positive, if a negative number is provided, the default value will be used instead. If the width of the slider converted to pixels is less than the range (max – min), the value will be rounded to multiples of the step size.

Default value is 1.

Returns:
{float} Value of property step
getValue(): float
Gets current value of property value.

Define the value.

If the value is lower/higher than the allowed minimum/maximum, the value of the properties min/max are used instead.

Default value is 0.

Returns:
{float} Value of property value
getWidth(): sap.ui.core.CSSSize
Gets current value of property width.

Defines the width of the control.

Default value is 100%.

Returns:
{sap.ui.core.CSSSize} Value of property width
removeAllAriaLabelledBy(): sap.ui.core.Control[]
Removes all the controls in the association named ariaLabelledBy.
Since:
1.27.0
Returns:
{sap.ui.core.Control[]} An array of the removed elements (might be empty)
removeAriaLabelledBy(vAriaLabelledBy): sap.ui.core.Control
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Parameters:
{int|string|sap.ui.core.Control}vAriaLabelledBy The ariaLabelledByto be removed or its index or ID
Since:
1.27.0
Returns:
{sap.ui.core.Control} the removed ariaLabelledBy or null
setEnabled(bEnabled): sap.m.Slider
Sets a new value for property enabled.

Indicates whether the user can change the value.

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

Default value is true.

Parameters:
{boolean}bEnabled New value for property enabled
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setMax(fMax): sap.m.Slider
Sets a new value for property max.

The maximum value.

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

Default value is 100.

Parameters:
{float}fMax New value for property max
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setMin(fMin): sap.m.Slider
Sets a new value for property min.

The minimum value.

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

Default value is 0.

Parameters:
{float}fMin New value for property min
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setName(sName): sap.m.Slider
Sets a new value for property name.

The name property to be used in the HTML code for the slider (e.g. for HTML forms that send data to the server via submit).

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

Default value is .

Parameters:
{string}sName New value for property name
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setProgress(bProgress): sap.m.Slider
Sets a new value for property progress.

Indicate whether a progress bar indicator is shown.

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

Default value is true.

Parameters:
{boolean}bProgress New value for property progress
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setShowHandleTooltip(bShowHandleTooltip): sap.m.Slider
Sets a new value for property showHandleTooltip.

Indicate whether the handle tooltip is shown.

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

Default value is true.

Parameters:
{boolean}bShowHandleTooltip New value for property showHandleTooltip
Since:
1.31
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setStep(fStep): sap.m.Slider
Sets a new value for property step.

Define the amount of units to change the slider when adjusting by drag and drop.

Defines the size of the slider's selection intervals. (e.g. min = 0, max = 10, step = 5 would result in possible selection of the values 0, 5, 10).

The step must be positive, if a negative number is provided, the default value will be used instead. If the width of the slider converted to pixels is less than the range (max – min), the value will be rounded to multiples of the step size.

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

Default value is 1.

Parameters:
{float}fStep New value for property step
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
setValue(fNewValue): sap.m.Slider
Sets the property value.

Default value is 0.

Parameters:
{float}fNewValue new value for property value.
Returns:
{sap.m.Slider}this to allow method chaining.
setWidth(sWidth): sap.m.Slider
Sets a new value for property width.

Defines the width of the control.

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

Default value is 100%.

Parameters:
{sap.ui.core.CSSSize}sWidth New value for property width
Returns:
{sap.m.Slider} Reference to this in order to allow method chaining
stepDown(iStep?): sap.m.Slider
Decrements the value by multiplying the step the step with the given parameter.
Parameters:
{int}iStep?, Default: 1 The number of steps the slider goes down.
Returns:
{sap.m.Slider}this to allow method chaining.
stepUp(iStep?): sap.m.Slider
Increments the value by multiplying the step with the given parameter.
Parameters:
{int}iStep?, Default: 1 The number of steps the slider goes up.
Returns:
{sap.m.Slider}this to allow method chaining.