Class sap.m.StepInputModule: sap/m/StepInput

extends Control
implements IFormContent

The StepInput control allows the user to change the input values with predefined increments (steps).
Since: 1.40.
Constructor Summary
new sap.m.StepInput(sId?, mSettings?)Constructor for a new StepInput.
Event Summary
change(oControlEvent)

Is fired when one of the following happens:

  1. the text in the input has changed and the focus leaves the input field or the enter key is pressed.

Events borrowed from class sap.ui.core.Control
Method Summary
sap.m.StepInput.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.m.StepInput with name sClassName and enriches it with the information contained in oClassInfo.
sap.m.StepInput.getMetadata()Returns a metadata object for class sap.m.StepInput.
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.m.StepInput.
detachChange(fnFunction, oListener)Detaches event handler fnFunction from the change event of this sap.m.StepInput.
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.
getDisplayValuePrecision()Gets current value of property displayValuePrecision.
getEditable()Gets current value of property editable.
getEnabled()Gets current value of property enabled.
getLargerStep()Gets current value of property largerStep.
getMax()Gets current value of property max.
getMin()Gets current value of property min.
getName()Gets current value of property name.
getPlaceholder()Gets current value of property placeholder.
getRequired()Gets current value of property required.
getStep()Gets current value of property step.
getValue()Gets current value of property value.
getValueState()Gets current value of property valueState.
getValueStateText()Getter for property valueStateText.
getWidth()Gets current value of property width.
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.
setEnabled(bEnabled)Sets a new value for property enabled.
setLargerStep(fLargerStep)Sets a new value for property largerStep.
setName(sName)Sets a new value for property name.
setPlaceholder(sPlaceholder)Sets a new value for property placeholder.
setRequired(bRequired)Sets a new value for property required.
setStep(fStep)Sets a new value for property step.
setValueStateText(sText)Setter for property valueStateText.
setWidth(sWidth)Sets a new value for property width.
Constructor Detail
new sap.m.StepInput(sId?, mSettings?)

Constructor for a new StepInput.

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)

Is fired when one of the following happens:

  1. the text in the input has changed and the focus leaves the input field or the enter key is pressed.
  2. One of the decrement or increment buttons is pressed
Parameters:
sap.ui.base.EventoControlEvent
sap.ui.base.EventProvideroControlEvent.getSource
objectoControlEvent.getParameters
stringoControlEvent.getParameters.valueThe new value of the control.
Method Detail
sap.m.StepInput.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.m.StepInput 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.m.StepInput.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.m.StepInput.
Returns:
sap.ui.base.MetadataMetadata object describing this class
addAriaDescribedBy(vAriaDescribedBy): sap.m.StepInput
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.m.StepInputReference to this in order to allow method chaining
addAriaLabelledBy(vAriaLabelledBy): sap.m.StepInput
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.m.StepInputReference to this in order to allow method chaining
attachChange(oData?, fnFunction, oListener?): sap.m.StepInput

Attaches event handler fnFunction to the change event of this sap.m.StepInput.

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.StepInput itself.

Is fired when one of the following happens:

  1. the text in the input has changed and the focus leaves the input field or the enter key is pressed.
  2. One of the decrement or increment buttons is pressed
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.m.StepInput itself
Returns:
sap.m.StepInputReference to this in order to allow method chaining
detachChange(fnFunction, oListener): sap.m.StepInput

Detaches event handler fnFunction from the change event of this sap.m.StepInput.

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.m.StepInputReference to this in order to allow method chaining
fireChange(mParameters?): sap.m.StepInput
Fires event change to attached listeners.
Parameters:
objectmParameters?Parameters to pass along with the event
stringmParameters.value?The new value of the control.
Returns:
sap.m.StepInputReference to this in order to allow method chaining
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[]
getDisplayValuePrecision(): int

Gets current value of property displayValuePrecision.

Determines the number of digits after the decimal point.

The value should be between 0 (default) and 20. In case the value is not valid it will be set to the default value.

Default value is 0.

Returns:
intValue of property displayValuePrecision
Since:
1.46
getEditable(): boolean

Gets current value of property editable.

Defines whether the control can be modified by the user or not. Note: A user can tab to the non-editable control, highlight it, and copy the text from it.

Default value is true.

Returns:
booleanValue of property editable
getEnabled(): boolean

Gets current value of property enabled.

Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.

Default value is true.

Returns:
booleanValue of property enabled
getLargerStep(): float

Gets current value of property largerStep.

Increases/decreases the value with a larger value than the set step only when using the PageUp/PageDown keys. Default value is 2 times larger than the set step.

Default value is 2.

Returns:
floatValue of property largerStep
getMax(): float

Gets current value of property max.

Sets the maximum possible value of the defined range.

Returns:
floatValue of property max
getMin(): float

Gets current value of property min.

Sets the minimum possible value of the defined range.

Returns:
floatValue of property min
getName(): string

Gets current value of property name.

Defines the name of the control for the purposes of form submission.

Returns:
stringValue of property name
Since:
1.44.15
getPlaceholder(): string

Gets current value of property placeholder.

Defines a short hint intended to aid the user with data entry when the control has no value.

Returns:
stringValue of property placeholder
Since:
1.44.15
getRequired(): boolean

Gets current value of property required.

Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor of sap.m.Label) cannot be established (e.g. one label should label multiple fields).

Default value is false.

Returns:
booleanValue of property required
Since:
1.44.15
getStep(): float

Gets current value of property step.

Increases/decreases the value of the input.

    Note:
  • The value of the step property should not contain more digits after the decimal point than what is set to the displayValuePrecision property, as it may lead to an increase/decrease that is not visible for the user. For example, if the value is set to 1.22 and the displayValuePrecision is set to one digit after the decimal, the user will see 1.2. In this case, if the the value of the step property is set to 1.005 and the user selects increase, the resulting value will increase to 1.2261 but the displayed value will remain as 1.2 as it will be rounded to the first digit after the decimal point.
  • Depending on what is set for the value and the displayValuePrecision properties, it is possible the displayed value to be rounded to a higher number, for example to 3.0 when the actual value is 2.99.

Default value is 1.

Returns:
floatValue of property step
getValue(): float

Gets current value of property value.

Determines the value of the StepInput and can be set initially from the app developer.

Default value is 0.

Returns:
floatValue of property value
getValueState(): sap.ui.core.ValueState

Gets current value of property valueState.

Accepts the core enumeration ValueState.type that supports None, Error, Warning and Success.

Default value is None.

Returns:
sap.ui.core.ValueStateValue of property valueState
getValueStateText(): string

Getter for property valueStateText. The text which is shown in the value state message popup.

Default value is empty/undefined

Returns:
stringthe value of property valueStateText
Since:
1.52
getWidth(): sap.ui.core.CSSSize

Gets current value of property width.

Defines the width of the control.

Returns:
sap.ui.core.CSSSizeValue of property width
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
setEnabled(bEnabled): sap.m.StepInput

Sets a new value for property enabled.

Indicates whether the user can interact with the control or not. Note: Disabled controls cannot be focused and they are out of the tab-chain.

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

Default value is true.

Parameters:
booleanbEnabledNew value for property enabled
Returns:
sap.m.StepInputReference to this in order to allow method chaining
setLargerStep(fLargerStep): sap.m.StepInput

Sets a new value for property largerStep.

Increases/decreases the value with a larger value than the set step only when using the PageUp/PageDown keys. Default value is 2 times larger than the set step.

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

Default value is 2.

Parameters:
floatfLargerStepNew value for property largerStep
Returns:
sap.m.StepInputReference to this in order to allow method chaining
setName(sName): sap.m.StepInput

Sets a new value for property name.

Defines the name of the control for the purposes of form submission.

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

Parameters:
stringsNameNew value for property name
Returns:
sap.m.StepInputReference to this in order to allow method chaining
Since:
1.44.15
setPlaceholder(sPlaceholder): sap.m.StepInput

Sets a new value for property placeholder.

Defines a short hint intended to aid the user with data entry when the control has no value.

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

Parameters:
stringsPlaceholderNew value for property placeholder
Returns:
sap.m.StepInputReference to this in order to allow method chaining
Since:
1.44.15
setRequired(bRequired): sap.m.StepInput

Sets a new value for property required.

Indicates that user input is required. This property is only needed for accessibility purposes when a single relationship between the field and a label (see aggregation labelFor of sap.m.Label) cannot be established (e.g. one label should label multiple fields).

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

Default value is false.

Parameters:
booleanbRequiredNew value for property required
Returns:
sap.m.StepInputReference to this in order to allow method chaining
Since:
1.44.15
setStep(fStep): sap.m.StepInput

Sets a new value for property step.

Increases/decreases the value of the input.

    Note:
  • The value of the step property should not contain more digits after the decimal point than what is set to the displayValuePrecision property, as it may lead to an increase/decrease that is not visible for the user. For example, if the value is set to 1.22 and the displayValuePrecision is set to one digit after the decimal, the user will see 1.2. In this case, if the the value of the step property is set to 1.005 and the user selects increase, the resulting value will increase to 1.2261 but the displayed value will remain as 1.2 as it will be rounded to the first digit after the decimal point.
  • Depending on what is set for the value and the displayValuePrecision properties, it is possible the displayed value to be rounded to a higher number, for example to 3.0 when the actual value is 2.99.

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

Default value is 1.

Parameters:
floatfStepNew value for property step
Returns:
sap.m.StepInputReference to this in order to allow method chaining
setValueStateText(sText): sap.m.StepInput

Setter for property valueStateText.

Default value is empty/undefined.

Parameters:
stringsTextNew value for property valueStateText.
Returns:
sap.m.StepInputthis to allow method chaining
Since:
1.52
setWidth(sWidth): sap.m.StepInput

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.

Parameters:
sap.ui.core.CSSSizesWidthNew value for property width
Returns:
sap.m.StepInputReference to this in order to allow method chaining