[Laszlo-checkins] r11294 - openlaszlo/trunk/lps/components/base
bargull@openlaszlo.org
bargull at openlaszlo.org
Wed Oct 1 10:02:43 PDT 2008
Author: bargull
Date: 2008-10-01 10:02:40 -0700 (Wed, 01 Oct 2008)
New Revision: 11294
Modified:
openlaszlo/trunk/lps/components/base/datalistselector.lzx
openlaszlo/trunk/lps/components/base/listselector.lzx
Log:
Change 20081001-bargull-Wwh by bargull at dell--p4--2-53 on 2008-10-01 15:02:28
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: swf9 compatible array type check
New Features:
Bugs Fixed: LPP-7099
Technical Reviewer: max
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
The type check for Arrays needs to be "item is Array" instead of "item['length']".
Tests:
Modified: openlaszlo/trunk/lps/components/base/datalistselector.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/datalistselector.lzx 2008-10-01 15:58:30 UTC (rev 11293)
+++ openlaszlo/trunk/lps/components/base/datalistselector.lzx 2008-10-01 17:02:40 UTC (rev 11294)
@@ -10,26 +10,23 @@
When the control key is down, any item may be added to the
selection.
Default: false -->
- <attribute name="multiselect" value="false"/>
+ <attribute name="multiselect" value="false" type="boolean"/>
<!--- @keywords private -->
- <attribute name="_forcemulti" value="false"/>
+ <attribute name="_forcemulti" value="false" type="boolean"/>
<!-- already defined in LzNode -->
<!--<attribute name="cloneManager" value="null"/>-->
- <method name="isRangeSelect" args="item">
- var allowselect = false;
- if (multiselect) allowselect = super.isRangeSelect(item);
- return allowselect;
- </method>
- <method name="isMultiSelect" args="item">
- var allowselect = false;
- if (_forcemulti) allowselect = true;
- else if (multiselect) allowselect = super.isMultiSelect(item);
- return allowselect;
- </method>
- <method name="select" args="item"> <![CDATA[
- if (item['length'] && multiselect) {
+ <method name="isRangeSelect" args="item" override="true"><![CDATA[
+ return this.multiselect && super.isRangeSelect(item);
+ ]]></method>
+
+ <method name="isMultiSelect" args="item" override="true"><![CDATA[
+ return this._forcemulti || (this.multiselect && super.isMultiSelect(item));
+ ]]></method>
+
+ <method name="select" args="item" override="true"><![CDATA[
+ if (this.multiselect && item is Array) {
this._forcemulti = true;
for (var i=0; i < item.length; i++) {
super.select(item[i]);
@@ -38,8 +35,7 @@
} else {
super.select(item);
}
- ]]>
- </method>
+ ]]></method>
<!---
if no selection, return null
Modified: openlaszlo/trunk/lps/components/base/listselector.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/listselector.lzx 2008-10-01 15:58:30 UTC (rev 11293)
+++ openlaszlo/trunk/lps/components/base/listselector.lzx 2008-10-01 17:02:40 UTC (rev 11294)
@@ -10,34 +10,30 @@
When the control key is down, any item may be added to the
selection.
Default: false -->
- <attribute name="multiselect" value="false"/>
+ <attribute name="multiselect" value="false" type="boolean"/>
<!--- @keywords private -->
- <attribute name="_forcemulti" value="false"/>
+ <attribute name="_forcemulti" value="false" type="boolean"/>
- <method name="isRangeSelect" args="item">
- var allowselect = false;
- if (multiselect) allowselect = super.isRangeSelect(item);
- return allowselect;
- </method>
- <method name="isMultiSelect" args="item">
- var allowselect = false;
- if (_forcemulti) allowselect = true;
- else if (multiselect) allowselect = super.isMultiSelect(item);
- return allowselect;
- </method>
+ <method name="isRangeSelect" args="item" override="true"><![CDATA[
+ return this.multiselect && super.isRangeSelect(item);
+ ]]></method>
- <method name="select" args="item"> <![CDATA[
- if (item['length'] && multiselect) {
- this._forcemulti = true;
- for (var i=0; i < item.length; i++) {
- super.select(item[i]);
- }
- this._forcemulti = false;
- } else {
- super.select(item);
- }
- ]]>
- </method>
+ <method name="isMultiSelect" args="item" override="true"><![CDATA[
+ return this._forcemulti || (this.multiselect && super.isMultiSelect(item));
+ ]]></method>
+
+ <method name="select" args="item" override="true"><![CDATA[
+ if (this.multiselect && item is Array) {
+ this._forcemulti = true;
+ for (var i=0; i < item.length; i++) {
+ super.select(item[i]);
+ }
+ this._forcemulti = false;
+ } else {
+ super.select(item);
+ }
+ ]]></method>
+
<!---
if no selection, return null<br/>
if multiselect, return an array of values<br/>
More information about the Laszlo-checkins
mailing list