IoSvComponent ReferenceThe IoSvComponent class is intended as a superclass for components returned by user input and output state variables. It has no defined string. It implements some standard setup and methods for all user inputs and outputs.
The IoSvComponent class provides default setValue() and setDisabled() methods. These methods are intended for parent components (e.g., the state variable component implementations) to set input or output DOM element properties dynamically without having to remount the child component with different attributes. The default implementation makes some assumptions about how any child components or nodes are rendered and should be overridden by subclasses as appropriate.
sVar (required)class: IoSvComponent
super(parent, template)
The IoSvComponent constructor sets up the following component instance properties:
sVar_mon.sVarsVar._mon.isDisabledsVar is an input state variable and the valueOnly attribute is not set, the it sets up an SvMonitor instance for sVar.childSv.isDisabled.parenttemplateThese methods are intended to be used by parent components to dynamically change the properties of the rendered components without re-rendering.
onUserChange()onUserChange(value)
A method to be called by subclasses when a user changes an input. It calls the sVar state variable's the userChange() method with the value and forces a synchronization that will reset the value of the input to the state variable value if the userChange() rejects or modifies the value the user input.
valuesync()sync()
This overrides the default Component sync() method. It calls the setValue() method when the sVar state variable's value has changed since the last call to sync(). It also calls the setDisabled() method when the sVar state variable's childSv.isDisabled state variable value has changed since the last call to sync().
setValue()setValue(value)
By default, setValue() will set the value property of the first component node to value, if this component has no child components. When this component has child components, it will call the setValue() method of the first child component. A component subclass can override this method to do something more specific to the subclass' implementation.
valuesetDisabled()setDisabled(disabled)
By default, setDisabled() will set the disabled property of the first component node to disabled, if this component has no child components. When this component has child components, it will call the setDisabled() method of the first child component. A component subclass can override this method to do something more specific to the subclass' implementation.
disabledsVarThe input or output state variable that this component is associated with.
An object.
_mon.sVarAn SvMonitor instance for sVar.
An SvMonitor.
_mon.isDisabledIf the sVar state variable is an input (isInput) and this component's valueOnly attribute is falsey, the _mon.isDisabled is an SvMonitor instance for sVar.childSv.isDisabled.
An SvMonitor.
This component does not render any DOM elements itself. That is left up to the subclass implementation.