Serial Number Input state variables represent an aircraft serial number entered by the user. The state variable is defined by the aircraft application (source/app/common/aero/serialNumSv.js), not by the base MVCS. It depends on the aircraft type data in acData, and the rendered input monitors sv.ac_data so it updates when the selected aircraft model changes.
The value is a string of digits. The number of digits is set by acData.serialWidth. Whether the value is displayed with leading zeros depends on acData.serialFixedWidth:
acData.serialFixedWidth is set, the serial number is fixed width. The displayed value and the value entered by the user are padded with leading zeros to acData.serialWidth digits (or truncated to that width if longer).0 is retained).'serialNumInput', class: SerialNumInputSvctl.createPage({
...,
stateVarInfo:[
{type:'serialNumInput', ...},
],
})
infoinfo object can contain the following properties, but subclasses of StateVar may have additional properties:info properties.info properties.info properties.dflt (optional)'0' padded with leading zeros to acData.serialWidth digits, evaluated when the state variable is created.Note: The component() method returns a component that renders an <input type="text"> (see Component attributes).
fmtVal()fmtVal()
Returns the displayed form of the value. If the value is an Error, returns the Error text. If isFixedWidth is true, returns the value padded (or truncated) to acData.serialWidth digits. Otherwise returns the value with leading zeros removed.
A String.
isFixedWidth (read only)True if the current aircraft model's serial numbers are fixed width (acData.serialFixedWidth is set).
A Boolean.
The component behaves as follows:
valueOnly attribute is set, the component renders as a Text Output component.0 through 9 are removed as the user types.acData.serialWidth digits before the state variable is updated through onUserChange.sv.ac_data changes.<input type="text"> with the size and maxLength attributes set to acData.serialWidth.<input> element's value is synchronized with fmtVal().<input> element will have a className that contains 'svIo_serialNumInput'.