Name
baseformitem — an abstract class for components which are used in a form
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.
Details
Properties (6)
-
changed
-
<attribute name="changed" value="false" />
Boolean to determine whether the baseformitem was changed. Default
is false.
-
ignoreform
-
<attribute name="ignoreform" value="false" />
-
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" />
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()
-
public function commit();
Commit value and set changed to false.
-
findForm()
-
<method name="findForm" />
public function findForm();
Finds a baseform ancestor
-
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" />
Event sent when baseformitem is changed. Only sent once when true
or once when false.
-
onvalue
-
<attribute name="onvalue" />
Event sent whenever checkbox value changes.
LZX Synopsis
<class name="
baseformitem" extends="
basevaluecomponent
">
<attribute name="
changed
" value="
false" />
<attribute name="
submit
" type="
boolean" value="
${enabled}" />
<attribute name="
submitname
" type="
string" value="
" />
<attribute name="
value
" value="
null" />
<method name="
setChanged
" args="
changed,
skipform" />
<method name="
setValue
" args="
v,
isinitvalue" />
<method name="
toXML
" args="
convert" />
</class>
JavaScript Synopsis
public
baseformitem extends
basevaluecomponent
{
prototype public function
applyData
(
d : Any);
prototype public function
commit
();
prototype public function
init
();
prototype protected function
setChanged
(
changed : Boolean,
skipform : Boolean);
prototype public function
setValue
(
v : Any,
isinitvalue : Boolean);
prototype public function
toXML
(
convert : Boolean);
}