baselistitem.lzx
<library>
<include href="base/basevaluecomponent.lzx"/>
<class name="baselistitem" extends="basevaluecomponent" clickable="true" focusable="false">
<attribute name="selected" value="false
" setter="this._setSelected(selected)"/>
<event name="onselected"/>
<event name="onselect"/>
<attribute name="_selectonevent" value="onclick
" type="string" setter="this.setSelectOnEvent(_selectonevent)"/>
<setter name="datapath" args="dp">
if (null != this.datapath) {
this.datapath.setXPath(dp);
} else {
var data_args = { xpath : dp }
if (this._parentcomponent.dataoption == "lazy" ||
this._parentcomponent.dataoption == "resize") {
data_args.replication = _parentcomponent.dataoption;
if (parent['spacing'])
data_args.spacing = parent.spacing;
} else if (this._parentcomponent.dataoption == "pooling") {
data_args.pooling = true;
}
new lz.datapath ( this, data_args );
}
</setter>
<attribute name="_valuedatapath" value="null
"/>
<attribute name="_textdatapath" value="null
"/>
<method name="dataBindAttribute" args="attr, path, type">
if (this._parentcomponent.dataoption == "lazy" ||
this._parentcomponent.dataoption == "resize") {
if (attr == 'text') this._textdatapath = path;
else if (attr == 'value') this._valuedatapath = path;
}
super.dataBindAttribute(attr, path, type);
</method>
<method name="setSelectOnEvent" args="es">
this._selectDL = new LzDelegate(this,'doClick',this,es);
</method>
<method name="doClick" args="ignore">
// FIXME [hqm 2006-09] LPP-2829 is it really ok that _parentcomponent is ever null?
if (this._parentcomponent) {
this._parentcomponent.select(this);
}
</method>
<method name="_doMousedown" args="ignore">
super._doMousedown(ignore);
var parcomp = this._parentcomponent;
if (!this.focusable && parcomp && parcomp.focusable) {
parcomp.__focusfromchild = true;
lz.Focus.setFocus(parcomp, false); // false => focus from mouse
parcomp.__focusfromchild = false;
}
</method>
<method name="setSelected" args="s">
this.selected = s;
if (this.onselect.ready) this.onselect.sendEvent(this);
if (this.onselected.ready) this.onselected.sendEvent(this);
</method>
<method name="_setSelected" args="s">
// set the value of the 'selected' attribute here
// since this may be called before the selection manager is
// created
this.selected = s;
if (s) {
if ($debug) {
if (s == "false") {
Debug.warn("attempt to set %s.selected to %#w, interpreted as true", this, s);
}
}
parent.select(this);
}
</method>
<method name="setHilite" args="hilite">
// abstract base method
</method>
<doc>
<tag name="shortdesc"><text>a group of these are managed by a baselist</text></tag>
<text>
<p>See <classname>baselist</classname> for details.</p>
</text>
</doc>
</class>
</library>
Cross References
Includes
Classes