Name

baseedittext

Synopsis

LZX: baseedittext
JavaScript: lz.baseedittext
Type: Class
Access: public
Topic: Incubator.Components
Declared in: lps/components/incubator/baseedittext.lzx

Description

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 » baseedittext

Known Subclasses

Details

Properties (14)

fgcolor
<attribute name="fgcolor" />
private var fgcolor;
Setting the fgcolor of text has the unfortunate effect of setting the hilite color as well, so it is disabled here.
_fgcolor
<attribute name="_fgcolor" value="0" />
private var _fgcolor;
_field
<attribute name="_field" value="null" />
private var _field;
Reference to _internalinputtext. This is set by the _internalinputtext during its initialization. _internalinputtext is not defined by baseeditext and should be declared by subclasses for proper visual placement.
fontsize
<attribute name="fontsize" value="13" />
public var fontsize;
Font size of the text. Default is 13.
height
<attribute name="height" value="20" />
public var height;
The height of the edit text box, default: 20.
_initialtext
<attribute name="_initialtext" type="string" value="" />
private var _initialtext : String;
This should be null if not set during early init.
_initialtexty
<attribute name="_initialtexty" value="false" />
private var _initialtexty;
Boolean to see if baseedittext needs to place y position for text during init.
maxlength
<attribute name="maxlength" type="number" value="null" />
public var maxlength : Number;
The maximum number of chars that can be entered. Default is unlimited.
multiline
<attribute name="multiline" value="false" />
public var multiline;
Set to true for multiple lines. Default is false.
password
<attribute name="password" value="false" />
public final var password;
Set to true for a password field. Text will appear as ****. This attribute cannot be changed at runtime. Default: false.
pattern
<attribute name="pattern" type="string" value="$once{null}" />
public var pattern : String;
An expression to restrict the set of characters that are allowed to be entered. For example, [0-9]*, [012]*, [a-zA-Z]*, [0-9A-Z]*. You can restrict the number of characters using maxlength. Default is any character.
text
<attribute name="text" type="html" />
public var text : lz.html;
The text that appears in the component. Text and value are the same.
value
<attribute name="value" value="null" />
public var value;
The text that appears in the component. Text and value are the same.
width
<attribute name="width" value="106" />
public var width;
The width of the edit text box, default: 106.

Methods (16)

_applystyle()
<method name="_applystyle" args="s" />
private function _applystyle(s);
clearText()
<method name="clearText" args="isinitvalue" />
public function clearText(isinitvalue : Boolean);
Clears the text field.
getSelectionPosition()
<method name="getSelectionPosition" />
public function getSelectionPosition();
Get the current selection position.
getSelectionSize()
<method name="getSelectionSize" />
public function getSelectionSize();
Get the current selection size.
getText()
<method name="getText" />
public function getText() : String;
Returns the text displayed in this component. The same as calling getValue(false).
getValue()
<method name="getValue" />
public function getValue() : String;
Returns string displayed in this component. Also see getText().
init()
<method name="init" />
private function init();
_placeTextY()
<method name="_placeTextY" />
private function _placeTextY();
If multiline, places text two pixels from top, else it calculates the middle point for the textbox.
setHeight()
<method name="setHeight" args="h" />
private function setHeight(h);
Set baseedittext height and correctly place text for internalinputfield using _placeTextY().
setMaxlength()
<method name="setMaxlength" args="n" />
public function setMaxlength(n);
setMultiline()
<method name="setMultiline" args="ml" />
private function setMultiline(ml);
Set edittext's and _field's multiline attributes. Will affect text placement if multiline attribute changes.
setPattern()
<method name="setPattern" args="r" />
public function setPattern(r);
setSelection()
<method name="setSelection" args="start, end" />
public function setSelection(start : Number, end : Number);
Positions the text selection within the text field. If this object does not already have the focus, this has the ancillary effect of giving it the focus.
setText()
<method name="setText" args="t, isinitvalue" />
public function setText(t : String, isinitvalue : Boolean);
Set text. Wraps setValue().
setValue()
<method name="setValue" args="value, isinitvalue, _ignorecalldown" />
public function setValue(value : String, isinitvalue : Boolean, _ignorecalldown);
Set the value (text) of baseedittext.
_showEnabled()
<method name="_showEnabled" />
private function _showEnabled();

Events (1)

onvalue
<attribute name="onvalue" />
public event onvalue;
Sent when the value of the text changes.

LZX Synopsis

<class name="lz.baseedittext" extends=" lz.baseformitem ">
  <attribute name=" fgcolor " />
  <attribute name=" _fgcolor " value="0" />
  <attribute name=" _field " value="null" />
  <attribute name=" fontsize " value="13" />
  <attribute name=" height " value="20" />
  <attribute name=" _initialtext " type="string" value="" />
  <attribute name=" _initialtexty " value="false" />
  <attribute name=" maxlength " type="number" value="null" />
  <attribute name=" multiline " value="false" />
  <attribute name=" password " value="false" />
  <attribute name=" pattern " type="string" value="$once{null}" />
  <attribute name=" text " type="html" />
  <attribute name=" value " value="null" />
  <attribute name=" width " value="106" />
  <method name=" _applystyle " args="s" />
  <method name=" clearText " args="isinitvalue" />
  <method name=" getSelectionPosition " />
  <method name=" getSelectionSize " />
  <method name=" getText " />
  <method name=" getValue " />
  <method name=" init " />
  <event name=" onvalue " />
  <method name=" _placeTextY " />
  <method name=" setHeight " args="h" />
  <method name=" setMaxlength " args="n" />
  <method name=" setMultiline " args="ml" />
  <method name=" setPattern " args="r" />
  <method name=" setSelection " args="start, end" />
  <method name=" setText " args="t, isinitvalue" />
  <method name=" setValue " args="value, isinitvalue, _ignorecalldown" />
  <method name=" _showEnabled " />
</class>

JavaScript Synopsis

public lz.baseedittext extends  lz.baseformitem  {
  private var fgcolor ;
  private var _fgcolor ;
  private var _field ;
  public var fontsize ;
  public var height ;
  private var _initialtext  : String;
  private var _initialtexty ;
  public var maxlength  : Number;
  public var multiline ;
  public final var password ;
  public var pattern  : String;
  public var text  : lz.html;
  public var value ;
  public var width ;
  prototype private function _applystyle (s);
  prototype public function clearText (isinitvalue : Boolean);
  prototype public function getSelectionPosition ();
  prototype public function getSelectionSize ();
  prototype public function getText () : String;
  prototype public function getValue () : String;
  prototype private function init ();
  prototype public event onvalue ;
  prototype private function _placeTextY ();
  prototype private function setHeight (h);
  prototype public function setMaxlength (n);
  prototype private function setMultiline (ml);
  prototype public function setPattern (r);
  prototype public function setSelection (start : Number, end : Number);
  prototype public function setText (t : String, isinitvalue : Boolean);
  prototype public function setValue (value : String, isinitvalue : Boolean, _ignorecalldown);
  prototype private function _showEnabled ();
}