The attribute tag has two uses:
In a class definiiton, the attribute tag
defines an attribute that can be set in instances of the class.
<canvas height="30">
<class name="mybutton" extends="button">
</class>
<mybutton text="before" myattr="after"
onclick="setAttribute('text', this.myattr)"/>
</canvas>
In an instance, the attribute tag attaches an attribute to the instance. The attribute can be accessed from script.
<canvas height="30">
<class name="mybutton" extends="button">
<attribute name="myattr" type="string" value="after"/>
</class>
<mybutton text="before"
onclick="setAttribute('text', this.myattr)">
</mybutton>
</canvas>
See the Developer's Guide for a complete discussion.
Also see the documentation for class and the general description of LZX attributes. The Classes tutorial describes how
to use attributes to define a class.
Initial Attributes (6)
Initial Attributes are given as attributes in LZX but are not generally available as properties in JavaScript.
attribute
name=$when
value{expression}. The
default for
when value is @c{always}, for
example: <view
title="$once{computeTitle()}" /> sets the
title of the view to a computed value and
<view title="${parent.subtitle}" \>
will cause the title of the view to
track @c{parent.subtitle}.
Copyright © 2002-2007 Laszlo Systems, Inc. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary information of Laszlo Systems, Inc. Use is subject to license terms.