<edittext>
text input component with lz components look and feel

JavaScript: lz.edittext

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 56. Simple edittext

<canvas bgcolor="blue" height="60">
              <edittext width="200" x="20" y="20">default text goes here</edittext>
              </canvas>

This component provides the look and feel for user editable text, data binding, and focus events.

Attributes

Name (CSS property) Type (tag) Type (js) Default Category
height expression any 26 read/write
  The height of the edit text box.
maxlength number Number null read/write
  The maximum number of chars that can be entered.
multiline expression any false initialize-only
  Set to true for multiple lines.
password expression any false initialize-only
  Set to true for a password field. Text will appear as ****.
pattern string String   read/write
  A regular expression describing set of characters allowed in this field. Restrict the characters that can be entered to a pattern specified by a regular expression. Currently only the expression [ ]* enclosing a set of characters or character ranges, preceded by an optional "^", is supported. examples: [0-9]* , [a-zA-Z0-9]*, [^0-9]*
resizable expression any false initialize-only
  Set to true if you plan to change the width or height of the component at run-time.
text text String   read/write
  The text that appears in the component.
text_y number Number multiline ? 2 : Math.round(((this.height - this.field.getTextHeight())/2)) read/write
  the y position of the text. default: centered, unless it is mutltiline
width expression any 106 read/write
  The width of the edit text box.

Attributes inherited from <basevaluecomponent>

type, value

Methods

clearText()
edittext.clearText();
Clears the text field.

getText()
edittext.getText();
Returns the string displayed in this component, like getValue().
Returns Type Description
  String the string displayed.

getValue()
edittext.getValue();
Returns string displayed in this component, like .text.
Returns Type Description
  String the string displayed.

setSelection()
edittext.setSelection(start : Number, end : Number);
Positions the text selection within the text field.
Parameter Name Type Description
start Number The beginning of the text selection, or the position for the text cursor if no end is given. The index is 0 based.
end Number The end of the text selection. Optional. If not given, then the text cursor is positioned at the start point, but no text is selected.

updateText()
edittext.updateText();
Updates the text property of the component to the text that is entered in its input field.

Methods inherited from lz.Eventable

destroy, setAttribute

Events

Events inherited from <baseformitem>

onchanged, onvalue

Events inherited from <node>

onconstruct, ondata, oninit

Events inherited from lz.Eventable

ondestroy