Author: ptw
Date: 2007-08-10 13:46:33 -0700 (Fri, 10 Aug 2007)
New Revision: 6007

Modified:
   openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
   
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
   openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx
   openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
Log:
Change 20070808-ptw-E by [EMAIL PROTECTED] on 2007-08-08 16:24:00 EDT
    in /Users/ptw/OpenLaszlo/wafflecone
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone

Summary: Update explicit replicator tests

Bugs Fixed:
LPP-4487 'test/explicit-replicators/replicator.lzx not working'

Technical Reviewer: mamye (pending)

Details:
    Pablo change the API of simple replicator.  Conform to that.
    Updated test-replicator to have a better layout, and commented out
    scrollbars with bug filed to fix them.

    Silence warnings in replicator.  Test for ready before sending events.

    Fix replicationselectionmanager to work as a sibling to the
    explicit replicator.

Tests:
    Inspection



Modified: 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx   
    2007-08-10 18:52:18 UTC (rev 6006)
+++ 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicator.lzx   
    2007-08-10 20:46:33 UTC (rev 6007)
@@ -105,6 +105,9 @@
     // Spacing between replications
     var spacing = 0;
 
+    var dataset = null;
+    var xpath = null;
+
     //  The list of elements controlled by this replicator
     var clones = null;
     var nodes = null;
@@ -160,7 +163,7 @@
         this.setAttribute("replicatedsize", this.clones.length == 0
                      ? 0
                      : 
this.clones[this.clones.length-1][this._sizes[this.axis]]);
-        this.onnodes.sendEvent();
+        if (this.onnodes.ready) { this.onnodes.sendEvent(); }
     }
 
     //  Insert a node in existing list of elements.

Modified: 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
       2007-08-10 18:52:18 UTC (rev 6006)
+++ 
openlaszlo/branches/wafflecone/lps/components/utils/replicator/replicatorselectionmanager.lzx
       2007-08-10 20:46:33 UTC (rev 6007)
@@ -11,7 +11,7 @@
           super.init.apply(this, arguments);
           // If replicator is not specified, search siblings for a replicator
           if (! this.replicator) {
-            var s = parent.subnodes;
+            var s = immediateparent.subnodes;
             if (s == null) return;
             for (var i = s.length-1; i >= 0; i-- ) {
                 var si = s[ i ];

Modified: 
openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx
===================================================================
--- openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx     
2007-08-10 18:52:18 UTC (rev 6006)
+++ openlaszlo/branches/wafflecone/test/explicit-replicators/replicator.lzx     
2007-08-10 20:46:33 UTC (rev 6007)
@@ -9,8 +9,8 @@
   </dataset>
 
   <view name="bar">
+    <simplelayout axis="y" spacing="2" />
     <replicator name="foo"
-                axis="y" spacing="2"
                 dataset="mydata"
                 xpath="'/product/'">
       <view bgcolor="red" height="23">

Modified: 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx    
    2007-08-10 18:52:18 UTC (rev 6006)
+++ 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx    
    2007-08-10 20:46:33 UTC (rev 6007)
@@ -1,48 +1,52 @@
 <!-- Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved. -->
 <canvas>
+    <debug height="90%" width="40%" x="55%" y="5%" />
 
-    <window width="200" height="200" name="repltest"
+    <window width="20%" height="200" x="5%" y="5%" name="lazyrepltest"
             resizable="true" title="lazy replicator">
+        <replicatorselectionmanager id="lazyselman" name="selman" />
         <lazyreplicator id="lr">
-            <replicatorselectionmanager id="foo" name="selman"/>
             <handler name="oninit">
-                this.setNodes( [ 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 
-                                 89 , 144 , 233 , 377 , 610 , 987 , 
-                                 1597 , 2584 , 4181 , 6765 , 10946 , 
-                                 17711 , 28657 , 46368 , 75025 , 121393 , 
+                this.setNodes( [ 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 ,
+                                 89 , 144 , 233 , 377 , 610 , 987 ,
+                                 1597 , 2584 , 4181 , 6765 , 10946 ,
+                                 17711 , 28657 , 46368 , 75025 , 121393 ,
                                  196418 , 317811 , 514229 ] );
             </handler>
-            <text width="1000">
+            <text width="100">
                 <attribute name="selected" value="false"/>
-                <attribute name="bgcolor" 
+                <attribute name="bgcolor"
                            value="${selected ? 0xCCDDEE : null }"/>
 
                 <method name="update" args="data , n">
                     this.setText( n  + " : " + data );
                 </method>
                 <handler name="onclick">
+                    Debug.write( parent.selman.isSelected( this ) ,
+                                parent.selman.toggle );
                     parent.selman.select( this );
                 </handler>
             </text>
         </lazyreplicator>
-        <scrollbar id="sb"/>
+        <!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
+        <!-- NOT WORKING scrollbar id="lsb" scrolltarget="immediateparent" -->
     </window>
 
-    <window width="200" height="200" x="250"
+    <window width="20%" height="200" x="30%" y="5%" name="simplerepltest"
             resizable="true" title="replicator">
-        <replicator>
-            <selectionmanager name="selman"/>
+        <replicatorselectionmanager id="simpleselman" name="selman" />
+        <simplelayout axis="y" spacing="0" />
+        <replicator id="sr">
             <handler name="oninit">
-                this.setNodes( [ 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 , 
-                                 89 , 144 , 233 , 377 , 610 , 987 , 
-                                 1597 , 2584 , 4181 , 6765 , 10946 , 
-                                 17711 , 28657 , 46368 , 75025 , 121393 , 
+                this.setNodes( [ 2 , 3 , 5 , 8 , 13 , 21 , 34 , 55 ,
+                                 89 , 144 , 233 , 377 , 610 , 987 ,
+                                 1597 , 2584 , 4181 , 6765 , 10946 ,
+                                 17711 , 28657 , 46368 , 75025 , 121393 ,
                                  196418 , 317811 , 514229 ] );
             </handler>
-            <simplelayout/>
-            <text width="1000">
+            <text width="100">
                 <attribute name="selected" value="false"/>
-                <attribute name="bgcolor" 
+                <attribute name="bgcolor"
                            value="${selected ? 0xCCDDEE : null }"/>
 
                 <method name="setSelected" args="isSel">
@@ -59,7 +63,9 @@
                 </handler>
             </text>
         </replicator>
-        <scrollbar/>
+        <!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
+        <!-- NOT WORKING scrollbar id="ssb" scrolltarget="immediateparent" -->
     </window>
 
 </canvas>
+<!-- Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved. -->


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to