Numeric output state variables represent numbers displayed to the user. Each rendered component will display according to the format specified in the state variable.
'numericOutput', class: NumOutputSvctl.createPage({
...,
stateVarInfo:[
{type:'numericOutput', ...},
],
})
infoinfo object can contain the following properties, but subclasses of StateVar may have additional properties:fmt (optional)
A NumFmt format string (fmtStr). A NumFmt instance is not accepted here (it would be passed to a NumFmt constructor as the format string and fail). The format's limits are not set from info; info.min and info.max are ignored.
If no fmt is provided, a format string of '8' is assumed.
dflt (optional)
The initial value. The default is INVALID_NONE, which is displayed as '-'.
Note: If the info.id contains a subName (e.g., 'myPage_mySv_kg'), it will be considered a unit specifier. If the Component has the showUnits attribute, the unit abbreviation for the unit subName will be displayed after the number.
val([value])Gets or sets the value. A value that is not a finite number, NaN, or an Error (for example, undefined, null, or a string) is logged and stored as INVALID_NONE. The value is passed through fmt.apply() before being stored.
fmtVal()Returns the value formatted by the format. Returns '-' if the value is outside the format's range (the condition is logged), or the Error text if the value is an Error.
isValid([value])True if the OutputSv test passes and the format's isValid(value) passes.
Note: The component() method returns a NumOutputSvCmp.
childSv.fmtA NumFmt instance specifies the numeric format. The instance is held in the child state variable childSv.fmt (a modelObject); read it as sVar.childSv.fmt.value. Unlike numericInput, a numericOutput has no fmt, min, or max properties and applies no limits other than those in the format.
A NumFmt instance.
isNumberAlways true for numericOutput.
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.
fmtA NumFmt instance or format string that overrides the state variable's format for this component only.
<span> with the value attribute set according to the state variable value.<span> contents will be synchronized with the state variable value.<span> element will have a className that contains 'svIo_numOutput'.