Name

baseformitem — an abstract class for components which are used in a form

Synopsis

LZX: baseformitem
JavaScript: baseformitem
Type: Class
Access: public
Topic: Components.Base Components
Declared in: lps/components/base/baseformitem.lzx

Description

This abstract class works with form or baseform. All form components subclass this.

An abstract class for components which might submit data to a form. Baseformitem supports listening for a changed value. A value is changed if the current value was modified at any point.

Superclass Chain

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

Known Subclasses

Known Direct Subclasses: basecombobox, basedatacombobox, baseedittext, baselist, checkbox, edittext, stepper

Details

Properties (6)

changed
<attribute name="changed" value="false" />
public var changed;
Boolean to determine whether the baseformitem was changed. Default is false.
ignoreform
<attribute name="ignoreform" value="false" />
public var ignoreform;
rollbackvalue
<attribute name="rollbackvalue" value="null" />
public var rollbackvalue;
submit
<attribute name="submit" type="boolean" value="${enabled}" />
public var submit : Boolean;
If submit is true, then the value of this element will be submitted with the form. By default, submit is true when enabled.
submitname
<attribute name="submitname" type="string" value="" />
public var submitname : String;
The name used when submitting the data of the form item. If no submitname is given before oninit, the 'name' attribute is used. Unlike the name attribute, submitname may be changed at runtime.
value
<attribute name="value" value="null" />
public var value;
The value of the baseformitem. Default is null.

Methods (9)

applyData()
<method name="applyData" args="d" />
public function applyData(d : Any);
This implementation sets the applied data as an initalizater value. This is run by a datapath to get the data from a data node.
commit()
<method name="commit" />
public function commit();
Commit value and set changed to false.
findForm()
<method name="findForm" />
public function findForm();
Finds a baseform ancestor
init()
<method name="init" />
public function init();
rollback()
<method name="rollback" />
public function rollback();
Rollback value and set changed to false.
setChanged()
<method name="setChanged" args="changed, skipform" />
protected function setChanged(changed : Boolean, skipform : Boolean);
Setter to set baseformitem to changed. Should be called by subclasses whenever a value is set. The first time this is called, the changed value is not set since it assumes subclasses are setting their initial value.
setValue()
<method name="setValue" args="v, isinitvalue" />
public function setValue(v : Any, isinitvalue : Boolean);
Set the value for the baseformitem.
toXML()
<method name="toXML" args="convert" />
public function toXML(convert : Boolean);
This returns the value of the component in XML format: submit_name="value"
updateData()
<method name="updateData" />
public function updateData();
This implementation returns the value. This is run by a datapath to set the value to a data node.

Events (2)

onchanged
<attribute name="onchanged" />
public event onchanged;
Event sent when baseformitem is changed. Only sent once when true or once when false.
onvalue
<attribute name="onvalue" />
public event onvalue;
Event sent whenever checkbox value changes.

LZX Synopsis

<class name="baseformitem" extends=" basevaluecomponent ">
  <attribute name=" changed " value="false" />
  <attribute name=" ignoreform " value="false" />
  <attribute name=" rollbackvalue " value="null" />
  <attribute name=" submit " type="boolean" value="${enabled}" />
  <attribute name=" submitname " type="string" value="" />
  <attribute name=" value " value="null" />
  <method name=" applyData " args="d" />
  <method name=" commit " />
  <method name=" findForm " />
  <method name=" init " />
  <event name=" onchanged " />
  <event name=" onvalue " />
  <method name=" rollback " />
  <method name=" setChanged " args="changed, skipform" />
  <method name=" setValue " args="v, isinitvalue" />
  <method name=" toXML " args="convert" />
  <method name=" updateData " />
</class>

JavaScript Synopsis

public baseformitem extends  basevaluecomponent  {
  public var changed ;
  public var ignoreform ;
  public var rollbackvalue ;
  public var submit  : Boolean;
  public var submitname  : String;
  public var value ;
  prototype public function applyData (d : Any);
  prototype public function commit ();
  prototype public function findForm ();
  prototype public function init ();
  prototype public event onchanged ;
  prototype public event onvalue ;
  prototype public function rollback ();
  prototype protected function setChanged (changed : Boolean, skipform : Boolean);
  prototype public function setValue (v : Any, isinitvalue : Boolean);
  prototype public function toXML (convert : Boolean);
  prototype public function updateData ();
}