StateVar Component Reference

Table of Contents


Introduction

Syntax

tml`<StateVar sVar=sVarId />`

The StateVar component renders a state variable using the state variable ID or state variable instance given in the sVar attribute. The state variable must be either an input state variable or an output state variable. The state variable is rendered by calling its component() method, and the returned component class is used to render a component instance.

The StateVar component's attributes are processed, and both | and @ attributes are transformed into valueOnly and showUnits attributes, respectively. The remaining attributes are passed to the rendered component instance. If showUnits is specified, the unit abbreviation is retrieved by calling the state variable's fmtUnit() method and the result is used to set the units attribute for the rendered instance.

The normal component build process extracts state variables specified using the {{...}}, syntax, so the StateVar component is not typically used for page rendering.

Attributes

All other attributes are passed to the rendered component instance.

Children

The StateVar component ignores all children.