The interactive control is displayed either as a horizontal or a vertical line with a pointer and units of measurement. Users can move the pointer along the line to change values with graphical support.
Constructor for a new 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#constructor for a general description of the syntax of the settings object.
new sap.ui.commons.Slider(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 |
---|---|---|---|
editable | boolean | true | Using the slider interactively requires value "true". Visibility: public |
enabled | boolean | true | Switches enabled state of the control. Disabled fields have different colors, and can not be focused. Visibility: public |
height | sap.ui.core.CSSSize | 100% | Height of the vertical slider. |
labels | string[] | Labels to be displayed instead of numbers. Attribute totalUnits and label count should be the same Note: To show the labels |
|
max | float | 100 | Maximal value of the slider Note: If |
min | float | 0 | Minimal value of the slider. Note: If |
smallStepWidth | float | The grip can only be moved in steps of this width. Visibility: public |
|
stepLabels | boolean | false | Display step numbers for the ticks on the slider. Visibility: public |
totalUnits | int | Number of units that are displayed by ticks. The PageUp and PageDown keys navigate according to these units. Visibility: public |
|
value | float | 50 | Current value of the slider. (Position of the grip.) Note: If the value is not in the valid range (between |
vertical | boolean | false | Orientation of slider |
width | sap.ui.core.CSSSize | 100% | Width of the horizontal slider. Visibility: public |
Name | Cardinality | Type | Description |
---|---|---|---|
ariaDescribedBy | 0..n | sap.ui.core.Control |
Association to controls / IDs which describe this control (see WAI-ARIA attribute aria-describedby). |
ariaLabelledBy | 0..n | sap.ui.core.Control |
Association to controls / IDs which label this control (see WAI-ARIA attribute aria-labelledby). |
Event | Description |
---|---|
change |
Value was changed. This event is fired if the value has changed by a user action. |
liveChange |
Value was changed. This event is fired during the mouse move. The normal change event is only fired by mouseup. |
Method | Description |
---|---|
addAriaDescribedBy |
Adds some ariaDescribedBy into the association ariaDescribedBy. |
addAriaLabelledBy |
Adds some ariaLabelledBy into the association ariaLabelledBy. |
attachChange |
Attaches event handler When called, the context of the event handler (its Value was changed. This event is fired if the value has changed by a user action. |
attachLiveChange |
Attaches event handler When called, the context of the event handler (its Value was changed. This event is fired during the mouse move. The normal change event is only fired by mouseup. |
detachChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
detachLiveChange |
Detaches event handler The passed function and listener object must match the ones used for event registration. |
sap.ui.commons.Slider.extend |
Creates a new subclass of class sap.ui.commons.Slider with name
|
fireChange |
Fires event change to attached listeners. |
fireLiveChange |
Fires event liveChange 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. |
getEditable |
Gets current value of property editable. Using the slider interactively requires value "true". Default value is |
getEnabled |
Gets current value of property enabled. Switches enabled state of the control. Disabled fields have different colors, and can not be focused. Default value is |
getHeight |
Gets current value of property height. Height of the vertical slider. Default value is |
getLabels |
Gets current value of property labels. Labels to be displayed instead of numbers. Attribute totalUnits and label count should be the same Note: To show the labels |
getMax |
Gets current value of property max. Maximal value of the slider Note: If Default value is |
sap.ui.commons.Slider.getMetadata |
Returns a metadata object for class sap.ui.commons.Slider. |
getMin |
Gets current value of property min. Minimal value of the slider. Note: If Default value is |
getSmallStepWidth |
Gets current value of property smallStepWidth. The grip can only be moved in steps of this width. |
getStepLabels |
Gets current value of property stepLabels. Display step numbers for the ticks on the slider. Default value is |
getTotalUnits |
Gets current value of property totalUnits. Number of units that are displayed by ticks. The PageUp and PageDown keys navigate according to these units. |
getValue |
Gets current value of property value. Current value of the slider. (Position of the grip.) Note: If the value is not in the valid range (between Default value is |
getVertical |
Gets current value of property vertical. Orientation of slider Default value is |
getWidth |
Gets current value of property width. Width of the horizontal slider. Default value is |
removeAllAriaDescribedBy |
Removes all the controls in the association named ariaDescribedBy. |
removeAllAriaLabelledBy |
Removes all the controls in the association named ariaLabelledBy. |
removeAriaDescribedBy |
Removes an ariaDescribedBy from the association named ariaDescribedBy. |
removeAriaLabelledBy |
Removes an ariaLabelledBy from the association named ariaLabelledBy. |
setEditable |
Sets a new value for property editable. Using the slider interactively requires value "true". When called with a value of Default value is |
setEnabled |
Sets a new value for property enabled. Switches enabled state of the control. Disabled fields have different colors, and can not be focused. When called with a value of Default value is |
setHeight |
Sets a new value for property height. Height of the vertical slider. When called with a value of Default value is |
setLabels |
Sets a new value for property labels. Labels to be displayed instead of numbers. Attribute totalUnits and label count should be the same Note: To show the labels When called with a value of |
setMax |
Sets a new value for property max. Maximal value of the slider Note: If When called with a value of Default value is |
setMin |
Sets a new value for property min. Minimal value of the slider. Note: If When called with a value of Default value is |
setSmallStepWidth |
Sets a new value for property smallStepWidth. The grip can only be moved in steps of this width. When called with a value of |
setStepLabels |
Sets a new value for property stepLabels. Display step numbers for the ticks on the slider. When called with a value of Default value is |
setTotalUnits |
Sets a new value for property totalUnits. Number of units that are displayed by ticks. The PageUp and PageDown keys navigate according to these units. When called with a value of |
setValue |
Sets a new value for property value. Current value of the slider. (Position of the grip.) Note: If the value is not in the valid range (between When called with a value of Default value is |
setVertical |
Sets a new value for property vertical. Orientation of slider When called with a value of Default value is |
setWidth |
Sets a new value for property width. Width of the horizontal slider. When called with a value of Default value is |
Adds some ariaDescribedBy into the association ariaDescribedBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaDescribedBy | sap.ui.core.ID sap.ui.core.Control |
The ariaDescribedBy to add; if empty, nothing is inserted |
Adds some ariaLabelledBy into the association ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to add; if empty, nothing is inserted |
Attaches event handler fnFunction
to the change event of this sap.ui.commons.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.ui.commons.Slider
itself.
Value was changed. This event is fired if the value has changed by a user action.
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 |
Attaches event handler fnFunction
to the liveChange event of this sap.ui.commons.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.ui.commons.Slider
itself.
Value was changed. This event is fired during the mouse move. The normal change event is only fired by mouseup.
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.commons.Slider
.
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 |
Detaches event handler fnFunction
from the liveChange event of this sap.ui.commons.Slider
.
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.commons.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.
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 |
|
value | float |
Current value of the slider after a change. |
Fires event liveChange to attached listeners.
Param | Type | DefaultValue | Description |
---|---|---|---|
mParameters | object |
Parameters to pass along with the event |
|
value | float |
Current value of the slider after a change. |
Returns array of IDs of the elements which are the current targets of the association ariaDescribedBy.
Returns array of IDs of the elements which are the current targets of the association ariaLabelledBy.
Gets current value of property editable.
Using the slider interactively requires value "true".
Default value is true
.
Gets current value of property enabled.
Switches enabled state of the control. Disabled fields have different colors, and can not be focused.
Default value is true
.
Gets current value of property height.
Height of the vertical slider.
Default value is '100%'
.
Gets current value of property labels.
Labels to be displayed instead of numbers. Attribute totalUnits and label count should be the same
Note: To show the labels stepLabels
must be activated.
Gets current value of property max.
Maximal value of the slider
Note: If min
is larger than max
both values will be switched
Default value is 100
.
Gets current value of property min.
Minimal value of the slider.
Note: If min
is larger than max
both values will be switched
Default value is 0
.
Gets current value of property smallStepWidth.
The grip can only be moved in steps of this width.
Gets current value of property stepLabels.
Display step numbers for the ticks on the slider.
Default value is false
.
Gets current value of property totalUnits.
Number of units that are displayed by ticks. The PageUp and PageDown keys navigate according to these units.
Gets current value of property value.
Current value of the slider. (Position of the grip.)
Note: If the value is not in the valid range (between min
and max
) it will be changed to be in the valid range.
Default value is 50
.
Gets current value of property width.
Width of the horizontal slider.
Default value is '100%'
.
Removes an ariaDescribedBy from the association named ariaDescribedBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaDescribedBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaDescribedBy to be removed or its index or ID |
Removes an ariaLabelledBy from the association named ariaLabelledBy.
Param | Type | DefaultValue | Description |
---|---|---|---|
vAriaLabelledBy | int sap.ui.core.ID sap.ui.core.Control |
The ariaLabelledBy to be removed or its index or ID |
Sets a new value for property editable.
Using the slider interactively requires value "true".
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEditable | boolean | true |
New value for property |
Sets a new value for property enabled.
Switches enabled state of the control. Disabled fields have different colors, and can not be focused.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is true
.
Param | Type | DefaultValue | Description |
---|---|---|---|
bEnabled | boolean | true |
New value for property |
Sets a new value for property height.
Height of the vertical slider.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is '100%'
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sHeight | sap.ui.core.CSSSize | '100%' |
New value for property |
Sets a new value for property labels.
Labels to be displayed instead of numbers. Attribute totalUnits and label count should be the same
Note: To show the labels stepLabels
must be activated.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
sLabels | string[] |
New value for property |
Sets a new value for property max.
Maximal value of the slider
Note: If min
is larger than max
both values will be switched
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 100
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fMax | float | 100 |
New value for property |
Sets a new value for property min.
Minimal value of the slider.
Note: If min
is larger than max
both values will be switched
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 0
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fMin | float | 0 |
New value for property |
Sets a new value for property smallStepWidth.
The grip can only be moved in steps of this width.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
fSmallStepWidth | float |
New value for property |
Sets a new value for property stepLabels.
Display step numbers for the ticks on the slider.
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 |
---|---|---|---|
bStepLabels | boolean | false |
New value for property |
Sets a new value for property totalUnits.
Number of units that are displayed by ticks. The PageUp and PageDown keys navigate according to these units.
When called with a value of null
or undefined
, the default value of the property will be restored.
Param | Type | DefaultValue | Description |
---|---|---|---|
iTotalUnits | int |
New value for property |
Sets a new value for property value.
Current value of the slider. (Position of the grip.)
Note: If the value is not in the valid range (between min
and max
) it will be changed to be in the valid range.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is 50
.
Param | Type | DefaultValue | Description |
---|---|---|---|
fValue | float | 50 |
New value for property |
Sets a new value for property vertical.
Orientation of slider
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 |
---|---|---|---|
bVertical | boolean | false |
New value for property |
Sets a new value for property width.
Width of the horizontal slider.
When called with a value of null
or undefined
, the default value of the property will be restored.
Default value is '100%'
.
Param | Type | DefaultValue | Description |
---|---|---|---|
sWidth | sap.ui.core.CSSSize | '100%' |
New value for property |