Using the Attribute Reference

For more information on attributes in general, see an introduction to attributes. This document provides details on the attribute reference section which appears below the general description of each LZX element.

For an XML attribute (an attribute "Tag" listed in its Usage column), the value of an attribute can be supplied as the value of an attribute in the XML header. For example, the view tag is declared as having an x attribute. The following code will initialize the x attribute of the view named "myview" to 10:

<view name="myview" x="10"/>

Most attributes can also be set using the attribute element. (Exceptions are the id and resource attributes, and attributes of elements that do not correspond to LFC classes, such as font.) For example, the previous example could also be written:

<view name="myview">
<attribute name="x" value="10"/>
</view>







Name

The name of the attribute.

More on attributes








Usage

Describes whether an attribute may occur in an XML open tag, in JavaScript code that manipulates the properties of an object, or both.

Tag only
This attribute may be specified only in the element's XML tag.
JS only
This attribute is only available in JavaScript expressions or methods.
Tag & JS
This attribute is available in both XML tag and Javascript.

More on attributes








Type (Tag)

The XML type name of the attribute.

booleanLiteral
true or false
colorLiteral
A color of the form #hhh, #hhhhhh, rgb(rv, gv, bv) or a CSS color name, where h is a hexadecimal digit, rv, gv, and bv are numbers between 0.0 and 1.0 inclusive, and the CSS color names are from the table below.
black000000     
green008000     
silverC0C0C0     
lime00FF00     
gray808080     
olive808000     
whiteFFFFFF     
yellowFFFF00     
maroon800000     
navy000080     
redFF0000     
blue0000FF     
purple800080     
teal008080     
fuchsiaFF00FF     
aqua00FFFF     
numberLiteral
An integer or floating-point number.
sizeLiteral
A non-negative number used as a size or dimension.
boolean
A booleanLiteral, or an ${expression}.
color
A colorLiteral, or an ${expression}.
script
A sequence of ECMAScript commands.
expression
An ECMAScript expression.
reference
An ECMAScript expression that evaluates to an Object reference.
number
A numberLiteral, or an ${expression} which evaluates to a number.
size
A sizeLiteral, or an ${expression} which evaluates to a non-negative number.
numberExpression
A numberLiteral, an ${expression} which evaluates to a number, or a JavaScript expression (which is treated the same as an ${expression}.
sizeExpression
A sizeLiteral, an ${expression} which evaluates to a non-negative number, or a JavaScript expression (which is treated the same as an ${expression}.
css
A CSS property value list, of the form key: value or key: value; key: value.
opacity
A number between 0.0 and 1.0 (inclusive), or an ${expression} which evaluates to such a number.

More on attributes








type (JS)

JavaScript types start with a capital letter. These may be one of the native JavaScript types, listed below or an LZX class.

Native JavaScript types (See ECMA-262 standard for more detail on these types)

 

Boolean

true or false

 

String

single or double quotes may be used to specify a sequence of characters (e.g. var s = 'test' or var s = "test"

 

Number

used to specify simple values (e.g. var n = 4 or var n=4.2). Number type is also commonly used to specify a color, for which it is often convenient to use hexadecimal notation (e.g. var c = 0xFFFFFF for white, or 0x0099BB for turquoise)

 

Array

an ordered list of elements. The elements may be of any type and need not be of the same type.

 

Notes on documentation:

 

[LzNode]

An LZX class enclosed in brackets indicates an Array of these types.

 

dictionary

Also known as a hash, or JavaScript Object, the dictionary type indicates an unordered collection of name-value pairs. For example: {width:100, height:50, title:"my title"}

 

any

JavaScript APIs will often allow a parameter of any type. This is indicated by the word "any" in the type collumn.

 

More on attributes








Category

Clicking on the name of the category will take you to a description of that category. Here is a complete list of attribute types.

More on attributes