Output SV types inherit from the Model SV type (type:'modelValue', class:ModelValueSv). The class is OutputSv. The OutputSv class is intended to be the superclass for user outputs. It is not intended for direct use and has no published type string.
Instances of Output SV types will have the isOutput property set to true.
infoinfo object can contain the following properties, but subclasses of StateVar may have additional properties:
Note: the default component() method will return a component that uses the state variable's render() method as its render() method.
fmtVal()
Return a formatted value. The format information varies with subclass.
A string representing a formatted version of the value.
Notes:
isOutput property is only true for Output SV types.save property for Output SV types is 'none', if not specified at construction.classNameA CSS class string set on all representations of this state variable in the View. Uses the className childSv.
A CSS class string.
IoComponent should be superClass for all Components for input or output state variables. The IoComponent will setup an SvMonitor for the state variable passed in the sVar attribute and synchronizes the DOM value when it changes using the setValue() method. If the sVar is an input, it will set an SvMonitor for sVar.childSv.isDisabled and synchronize the DOM node's disabled attribute using the setDisabled() method.
sVarThe state variable (the instance, not just the ID) that is associated with this component. This attribute is automatically set by the {{...}} syntax.
setValue()setValue(value)
The default setValue() method first checks whether there are any child components. If so, it calls the first child component's setvalue() method. Otherwise, it sets the value property of the first component DOM node to value.
Subclasses should override this method if their implementation requires a different technique to set the value.
sync()sync()
The sync() method synchronizes the Dom value using the setValue() method. It also synchronizes the DOM node's disabled attribute using the setDisabled() method. Lastly, it calls super.sync() to synchronize child components.
sVarThe state variable associated with this component.
_mon.sVarThis Componennt's SvMonitor for sVar.
By convention, the subclasses of IoComponent should create create DOM elements that share some common properties.
'svIo_<type>' and svId_<sVar ID> in addition to any component className attributes and classSv values.data-cid attribute set to the ID of the Component. This is useful to quickly find the state of the controlling component using view.getComponentById().Subclasses are not required to obey these conventions.