Output SV Type Reference

Table of contents


Introduction

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.

Constructor

Parameters

Instance methods

Note: the default component() method will return a component that uses the state variable's render() method as its render() method.


Inherited methods


fmtVal()

Syntax

fmtVal()

Return a formatted value. The format information varies with subclass.

Return value

A string representing a formatted version of the value.


Instance properties

Inherited properties

Notes:


className

A CSS class string set on all representations of this state variable in the View. Uses the className childSv.

Value

A CSS class string.


Component

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.

Component attributes

Inherited attributes


sVar

The state variable (the instance, not just the ID) that is associated with this component. This attribute is automatically set by the {{...}} syntax.


Component methods

setValue()

Syntax

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()

Syntax

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.


Component properties

sVar

The state variable associated with this component.


_mon.sVar

This Componennt's SvMonitor for sVar.


Standard DOM element properties

By convention, the subclasses of IoComponent should create create DOM elements that share some common properties.

Subclasses are not required to obey these conventions.