Name

edittext — text input component with lz components look and feel

Synopsis

LZX: edittext
JavaScript: edittext
Type: Class
Access: public
Topic: Components.Laszlo Components
Declared in: lps/components/lz/edittext.lzx

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.

Superclass Chain

node (LzNode) » view (LzView) » basecomponent » basevaluecomponent » baseformitem » edittext

Known Subclasses

Details

Properties (9)

height
<attribute name="height" value="26" />
public var height;
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" />
public var width;
The width of the edit text box, default: 106.

Methods (6)

clearText()
<method name="clearText" />
public function clearText();
Clears the text field.
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=" resizable " />
  <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" />
  <method name=" clearText " />
  <method name=" getText " />
  <method name=" getValue " />
  <method name=" setMaxlength " args="n" />
  <method name=" setPattern " args="r" />
  <method name=" updateText " />
</class>

JavaScript Synopsis

public edittext extends  baseformitem  {
  public var height ;
  public var maxlength  : Number;
  public final var multiline ;
  public final var password ;
  public var pattern  : String;
  public final var resizable ;
  public var text  : String;
  public var text_y  : Number;
  public var width ;
  prototype public function clearText ();
  prototype public function getText () : String;
  prototype public function getValue () : String;
  prototype public function setMaxlength (n);
  prototype public function setPattern (r);
  prototype public function updateText ();
}