Author: ptw
Date: 2007-08-13 13:23:15 -0700 (Mon, 13 Aug 2007)
New Revision: 6033

Modified:
   openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
Log:
Change 20070813-ptw-I by [EMAIL PROTECTED] on 2007-08-13 15:52:57 EDT
    in /Users/ptw/OpenLaszlo/wafflecone/lps/components
    for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone/lps/components

Summary: Upgrade test-replicator test

New Features:
The test now presents explicit and implicit cases side-by-side for
easier comparison.

Technical Reviewer: mkratt (pending)
QA Reviewer: pkang (pending)

Details:
    Replicated the test to show simple and lazy replication both
    explicit and implicit for comparison.  Explicit lazy replication
    still does not interact correctly with scrollbars (LPP-4484).

Tests:
    IWFM



Modified: 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx
===================================================================
--- 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx    
    2007-08-13 19:57:47 UTC (rev 6032)
+++ 
openlaszlo/branches/wafflecone/test/explicit-replicators/test-replicator.lzx    
    2007-08-13 20:23:15 UTC (rev 6033)
@@ -1,71 +1,142 @@
 <!-- Copyright 2001-2007 Laszlo Systems, Inc.  All Rights Reserved. -->
 <canvas debug="true" proxied="false">
-    <debug height="90%" width="40%" x="55%" y="5%" />
+  <debug height="90%" width="40%" x="55%" y="5%" />
 
-    <window width="20%" height="200" x="5%" y="5%" name="lazyrepltest"
-            resizable="true" title="lazy replicator">
-        <replicatorselectionmanager id="lazyselman" name="selman" />
-        <lazyreplicator id="lr">
-            <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 ,
-                                 196418 , 317811 , 514229 ] );
-            </handler>
-            <text width="100">
-                <attribute name="selected" value="false"/>
-                <attribute name="bgcolor"
-                           value="${selected ? 0xCCDDEE : null }"/>
+  <dataset name="testdata">
+    <fibs>
+      <fib value="2" />
+      <fib value="3" />
+      <fib value="5" />
+      <fib value="8" />
+      <fib value="13" />
+      <fib value="21" />
+      <fib value="34" />
+      <fib value="55" />
+      <fib value="89" />
+      <fib value="144" />
+      <fib value="233" />
+      <fib value="377" />
+      <fib value="610" />
+      <fib value="987" />
+      <fib value="1597" />
+      <fib value="2584" />
+      <fib value="4181" />
+      <fib value="6765" />
+      <fib value="10946" />
+      <fib value="17711" />
+      <fib value="28657" />
+      <fib value="46368" />
+      <fib value="75025" />
+      <fib value="121393" />
+      <fib value="196418" />
+      <fib value="317811" />
+      <fib value="514229" />
+    </fibs>
+  </dataset>
 
-                <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>
-        <!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
-        <!-- NOT WORKING scrollbar id="lsb" scrolltarget="immediateparent" -->
-    </window>
+  <text>
+    Compare explicit and implicit replicator behavior
+  </text>
 
-    <window width="20%" height="200" x="30%" y="5%" name="simplerepltest"
-            resizable="true" title="replicator">
-        <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 ,
-                                 196418 , 317811 , 514229 ] );
-            </handler>
-            <text width="100">
-                <attribute name="selected" value="false"/>
-                <attribute name="bgcolor"
-                           value="${selected ? 0xCCDDEE : null }"/>
+  <window width="20%" height="20%" x="5%" y="5%" name="explicitlazyrepltest"
+          resizable="true" title="explicit lazy replicator">
+    <list width="${immediateparent.width}" height="${immediateparent.height}">
+      <replicatorselectionmanager name="selman" />
+      <lazyreplicator id="elr" dataset="testdata" xpath="'fibs/fib'">
+        <text width="100">
+          <attribute name="selected" value="false"/>
+          <attribute name="bgcolor"
+                     value="${selected ? 0xCCDDEE : null }"/>
+          <attribute name="index" value="$path{'position()'}" />
+          <attribute name="value" value="$path{'@value'}" />
+          <method name="applyData">
+            this.format('%s: %d', this.index, this.value);
+          </method>
+          <handler name="onclick">
+            Debug.write(parent.selman.isSelected( this ), 
parent.selman.toggle);
+            parent.selman.select( this );
+          </handler>
+        </text>
+      </lazyreplicator>
+      <!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
+      <!-- NOT WORKING scrollbar id="lsb" scrolltarget="immediateparent" -->
+    </list>
+  </window>
 
-                <method name="setSelected" args="isSel">
-                    parent.setCloneProperty( this, "selected", isSel );
-                </method>
+  <window width="20%" height="20%" x="30%" y="5%" name="implicitlazyrepltest"
+          resizable="true" title="implicit lazy replicator">
+    <list width="${immediateparent.width}" height="${immediateparent.height}">
+      <selectionmanager name="selman" />
+      <text width="100" id="ilr" datapath="testdata:/fibs/fib">
+        <attribute name="selected" value="false"/>
+        <attribute name="bgcolor"
+                   value="${('selected' in this &amp;&amp; this.selected) ? 
0xCCDDEE : null }"/>
+        <attribute name="index" value="$path{'position()'}" />
+        <attribute name="value" value="$path{'@value'}" />
+        <handler name="ondata">
+          this.format('%s: %d', this.index, this.value);
+        </handler>
+        <handler name="onclick">
+          Debug.write(parent.selman.isSelected( this ), parent.selman.toggle);
+          parent.selman.select( this );
+        </handler>
+        <method name="setSelected" args="value">
+          this.selected = value;
+          this.onselected.sendEvent(value);
+        </method>
+      </text>
+    </list>
+  </window>
 
-                <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>
-        </replicator>
-        <!-- FIXME: [2007-08-10 ptw] (LPP-4484) -->
-        <!-- NOT WORKING scrollbar id="ssb" scrolltarget="immediateparent" -->
-    </window>
+  <window width="20%" height="20%" x="5%" y="50%" name="explicitsimplerepltest"
+          resizable="true" title="explicit replicator">
+    <list width="${immediateparent.width}" height="${immediateparent.height}">
+      <replicatorselectionmanager name="selman" />
+      <simplelayout axis="y" spacing="0" />
+      <replicator id="esr" dataset="testdata" xpath="'/fibs/fib'">
+        <text width="100">
+          <attribute name="selected" value="false"/>
+          <attribute name="bgcolor"
+                     value="${selected ? 0xCCDDEE : null }"/>
+          <attribute name="index" value="$path{'position()'}" />
+          <attribute name="value" value="$path{'@value'}" />
+          <method name="applyData">
+            this.format('%s: %d', this.index, this.value);
+          </method>
+          <handler name="onclick">
+            Debug.write(parent.selman.isSelected( this ), 
parent.selman.toggle);
+            parent.selman.select( this );
+          </handler>
+        </text>
+      </replicator>
+    </list>
+  </window>
 
+  <window width="20%" height="20%" x="30%" y="50%" 
name="implicitsimplerepltest"
+          resizable="true" title="implicit replicator">
+    <list width="${immediateparent.width}" height="${immediateparent.height}">
+      <selectionmanager name="selman" />
+      <simplelayout axis="y" spacing="0" />
+      <text width="100" id="isr" datapath="testdata:/fibs/fib">
+        <attribute name="selected" value="false" setter="setSelected" />
+        <attribute name="bgcolor"
+                   value="${('selected' in this &amp;&amp; this.selected) ? 
0xCCDDEE : null }"/>
+        <attribute name="index" value="$path{'position()'}" />
+        <attribute name="value" value="$path{'@value'}" />
+        <handler name="ondata">
+          this.format('%s: %d', this.index, this.value);
+        </handler>
+        <handler name="onclick">
+          Debug.write(parent.selman.isSelected( this ), parent.selman.toggle);
+          parent.selman.select( this );
+        </handler>
+        <method name="setSelected" args="value">
+          this.selected = value;
+          this.onselected.sendEvent(value);
+        </method>
+      </text>
+    </list>
+  </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