[Laszlo-checkins] r8242 - openlaszlo/trunk/lps/components/base

bargull@openlaszlo.org bargull at openlaszlo.org
Wed Mar 12 18:05:34 PDT 2008


Author: bargull
Date: 2008-03-12 18:05:31 -0700 (Wed, 12 Mar 2008)
New Revision: 8242

Modified:
   openlaszlo/trunk/lps/components/base/datalistselector.lzx
Log:
Change 20080313-bargull-0 by bargull at dell--p4--2-53 on 2008-03-13 01:44:10
    in /home/Admin/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix bug in datalistselector#findIndex(..)

New Features:

Bugs Fixed: LPP-5579 - "getIndexForItem() bug when only 1 item in grid"

Technical Reviewer: promanik
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:
You can pass to "datalistselector#findIndex(..)" either a LzView or a LzDatapointer, the latter wasn't treated when there was no clonemanager on screen. 


Tests:
Attached at bug-report



Modified: openlaszlo/trunk/lps/components/base/datalistselector.lzx
===================================================================
--- openlaszlo/trunk/lps/components/base/datalistselector.lzx	2008-03-13 00:52:58 UTC (rev 8241)
+++ openlaszlo/trunk/lps/components/base/datalistselector.lzx	2008-03-13 01:05:31 UTC (rev 8242)
@@ -141,6 +141,14 @@
        ]]>
        </method>
        <method name="findIndex" args="s">  <![CDATA[
+            if ( ! immediateparent.subviews[0].cloneManager ) {
+                if (s instanceof LzView) {
+                    return (immediateparent.subviews[0] == s ? 0 : -1);
+                } else {
+                    return (immediateparent.subviews[0].datapath.p == s.p ? 0 : -1);
+                }
+            } 
+            
             var target_element;
             if (s instanceof LzView) {
                 target_element = s.datapath.p;
@@ -148,10 +156,6 @@
                 target_element = s.p;
             }
 
-            if ( ! immediateparent.subviews[0].cloneManager ) {
-                return (immediateparent.subviews[0] == s ? 0 : -1);
-            } 
-
             var nodelist = immediateparent.subviews[0].cloneManager.nodes;
             var found_index = -1;
             for (var i=0; i < nodelist.length; i++) {
@@ -269,7 +273,7 @@
     </class>
 </library>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved.              *
+* Copyright 2001-2008 Laszlo Systems, Inc.  All Rights Reserved.              *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->
 <!-- @LZX_VERSION@                                                         -->



More information about the Laszlo-checkins mailing list