[Laszlo-checkins] r11893 - openlaszlo/trunk/lps/components/base
jcrowley@openlaszlo.org
jcrowley at openlaszlo.org
Tue Nov 25 21:17:42 PST 2008
Author: jcrowley
Date: 2008-11-25 21:17:37 -0800 (Tue, 25 Nov 2008)
New Revision: 11893
Modified:
openlaszlo/trunk/lps/components/base/baselist.lzx
Log:
Change 20081015-laszlo-2 by laszlo at T43-L3XEXMW on 2008-10-15 12:14:03 EDT
in /home/laszlo/src/svn/openlaszlo/trunk-bigboss
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: add Method removeAllItems at Component baselist
New Features:
Bugs Fixed: LPP-4054 - add Method removeAllItems at Component baselist
Technical Reviewer: promanik
QA Reviewer: max
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details: Implemented a contributor fix, adding method
"removeAllItems" to component baselist. I sent
this out for review last fall, but it never got
checked in.
Tests: Run the following:
<canvas width="500" height="300">
<list name="list1">
<textlistitem text="soln1" selected="false"/>
<textlistitem text="soln2" selected="true"/>
<textlistitem text="soln3" selected="false"/>
</list>
<button y="80" onclick="list1.removeAllItems()"/>
</canvas>
Click the button.
Modified: openlaszlo/trunk/lps/components/base/baselist.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/baselist.lzx 2008-11-26 05:16:54 UTC (rev 11892)
+++ openlaszlo/trunk/lps/components/base/baselist.lzx 2008-11-26 05:17:37 UTC (rev 11893)
@@ -326,6 +326,20 @@
var item = _contentview.subviews[index];
_removeitem(item);
</method>
+
+ <!--- Removes all items from the list. -->
+ <method name="removeAllItems" >
+ <![CDATA[
+ // Sometimes a single cycle of the for below won't remove
+ // every subview, so we need to make sure it runs until it
+ // gets them all.
+ while(_contentview.subviews.length != 0){
+ for(var eg = 0; eg < _contentview.subviews.length; eg++){
+ _removeitem(_contentview.subviews[eg]);
+ }
+ }
+ ]]>
+ </method>
<!--- @keywords private -->
<method name="_removeitem" args="item">
More information about the Laszlo-checkins
mailing list