Name
edittext —
text input component with lz components look and feel
Description
The edittext
tag provides a text input field which has a
look and feel to match the lz component set. It can accept any
inputtext
attribute.
Example 44. Simple edittext
<canvas bgcolor="blue" height="60" >
<edittext width="200" x="20" y="20">default text goes here</edittext>
</canvas>
For details on how this component is constructed see the edittext section of
The Component Design Guide.
This component provides the look and feel for user editable text, data
binding, and focus events.
Details
Properties (9)
-
height
-
<attribute name="height" value="26" />
The height of the edit text box, default: 24.
-
maxlength
-
<attribute name="maxlength" type="number" value="null" />
public var maxlength : Number;
The maximum number of chars that can be entered.
-
multiline
-
<attribute name="multiline" value="false" />
public final var multiline;
Set to true for multiple lines, default: false.
-
password
-
<attribute name="password" value="false" />
public final var password;
Set to true for a password field. Text will appear as ****,
default: false.
-
pattern
-
<attribute name="pattern" type="string" value="" />
public var pattern : String;
An expression for a set of characters to restrict entry to.
-
resizable
-
<attribute name="resizable" />
public final var resizable;
Set to true if you plan to change the width or height of the
component at run-time, default: false.
-
text
-
<attribute name="text" type="text" />
public var text : String;
The text that appears in the component.
-
text_y
-
<attribute name="text_y" type="number" value="${multiline ? 2:this.height/2 - this.field.getTextHeight()/2 - 3}" />
public var text_y : Number;
the y position of the text. default: centered, unless it is mutltiline
-
width
-
<attribute name="width" value="106" />
The width of the edit text box, default: 106.
Methods (6)
-
clearText()
-
<method name="clearText" />
public function clearText();
-
getText()
-
<method name="getText" />
public function getText() : String;
Returns the string displayed in this component, like getValue().
-
getValue()
-
<method name="getValue" />
public function getValue() : String;
Returns string displayed in this component, like getText().
-
setMaxlength()
-
<method name="setMaxlength" args="n" />
public function setMaxlength(n);
-
setPattern()
-
<method name="setPattern" args="r" />
public function setPattern(r);
-
updateText()
-
<method name="updateText" />
public function updateText();
LZX Synopsis
<class name="
edittext" extends="
baseformitem
">
<attribute name="
height
" value="
26" />
<attribute name="
maxlength
" type="
number" value="
null" />
<attribute name="
multiline
" value="
false" />
<attribute name="
password
" value="
false" />
<attribute name="
pattern
" type="
string" value="
" />
<attribute name="
text
" type="
text" />
<attribute name="
text_y
" type="
number" value="
${multiline ? 2:this.height/2 - this.field.getTextHeight()/2 - 3}" />
<attribute name="
width
" value="
106" />
</class>
JavaScript Synopsis
public
edittext extends
baseformitem
{
public var
text
:
String;
prototype public function
getText
() :
String;
prototype public function
getValue
() :
String;
}