basevaluecomponent.lzx
<library>
<include href="base/basecomponent.lzx"/>
<class name="basevaluecomponent" extends="basecomponent">
<attribute name="value" value="null
"/>
<attribute name="type" type="string" value="expression
"/>
<method name="getValue">
return this.value == null ? this.text : this.value;
</method>
<method name="$lzc$getValue_dependencies" args="who, self">
// Since we don't know which one of these getValue will
// return, we have to depend on both of them
return [this, 'value', this, 'text'];
</method>
<method name="acceptValue" args="data, type=null">
if (type == null) type = this.type;
// Some subclasses (e.g., textlistitem) want to see the
// value as text, so we have to call the super method
super.acceptValue(data, type)
// This is the main feature of this subclass, to parse the
// textual data into a value of the proper type
this.acceptAttribute('value', type, data);
</method>
<method name="presentValue" args="type=null">
if (type == null) type = this.type;
// subclasses may override getValue
return lz.Type.presentTypeValue(type, this.getValue(), this, 'value');
</method>
<method name="$lzc$presentValue_dependencies" args="who, self, type=null">
// Our dependencies are just the dependencies of
// getValue and a dependency on our type
return [this, 'type'].concat(this.$lzc$getValue_dependencies(who, self));
</method>
<doc>
<tag name="shortdesc"><text>an abstract class for components which represent data</text></tag>
<text>
<p>
This abstract class provides a value attribute with data binding to a specific
valuedatapath.
</p>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes