Numeric Input state variables represent user number inputs. Each rendered component will display according to the format and limits specified in the state variable.
MVCS supports three types of numeric input mechanisms: a physical or virtual keyboard, a popup keypad, or a thumbwheel. The app Settings page can select the desired input mechanism for each device type by setting the set_inputType state variable. See Standard Settings Page.
If the state variable's ID contains a subName (e.g., 'myPage_mySv_kg'), it will be considered a unit specifier. If a rendered numeric input component has the showUnits attribute, the unit abbreviation for the unit subName will be displayed after the number.
'numericInput', class: NumInputSvctl.createPage({
...,
stateVarInfo:[
{type:'numericInput', ...},
],
})
infoinfo object can contain the following properties, but subclasses of StateVar may have additional properties:fmt (optional)
The fmt parameter can be one of the following:
fmtStr). If a format string is used, then a NumFmt instance will be created using this string along with any info.min and info.amx parameters. if no fmt is provided, a format string of '8' is assumed.
min (optional)
The minimum valid value. This is ignored if a NumFmt instance is provided in the fmt parameter.
max (optional)
The maximum valid value. This is ignored if a NumFmt instance is provided in the fmt parameter.
Note: If the info.id
Note: The component() method returns a NumInputSvCmp.
fmtA NumFmt instance specifies the desired numeric format and limits.
A NumFmt instance.
maxThe maximum valid value. Sets/gets fmt.max.
A Number.
minThe minimum valid value. Sets/gets fmt.min.
A Number.
isNumberAlways true for numericInput.
A Boolean.
isUnitTrue if the state variable has a unit subName.
A Boolean.
unitThe first subName. For example, 'kg' if the state variable ID is 'myPage_mySv_kg'.
A String.
inputTypeThe inputType attribute establishes a particular user input type that overrides the set_inputType state variable if it exists. The values can be:
'keyboard''keypad''thumbwheel'A String.
plusMinusIf plusMinus is true, then "-" and "+" buttons will apear to the left and right of the input. Pressing one of the buttons will increment or decrement the value by fmt.rndMult.
A Boolean.
keyboard inputType, the numericInput Component will render an <input type="number"> with the value, max, min, and step attributes set according to the respective state variable instance properties.<input> element may be converted to <input type="text"> when it loses focus.value attribute will be synchronized with the state variable value. The min, max and step attributes will be synchronized with respective properties in the NumFmt instance in the state variable's fmt property.<input> element will have a className that contains 'svIo_numInput'.inputType, the numericInput Component will render a <span>.<span> contents will be synchronized with the state variable value.