Author: lou
Date: 2008-01-18 04:51:10 -0800 (Fri, 18 Jan 2008)
New Revision: 7851

Modified:
   openlaszlo/trunk/docs/src/developers/databinding.dbk
   openlaszlo/trunk/docs/src/developers/programs/databinding-$14.lzx
Log:
Change 20080118-lou-J by [EMAIL PROTECTED] on 2008-01-18 08:43:18 AST
    in /Users/lou/src/svn/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: fix live example order in the databinding chapter of the dguide

Bugs Fixed: LPP-3936

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

Details: At some point, an example was inserted in this chapter, which threw
off the order of all following examples. Fix the order of the examples so
they appear in the proper sections.

One example file contained the wrong example; revert to the 3.4 version.
    

Tests: check that the examples match the 3.4 doc



Modified: openlaszlo/trunk/docs/src/developers/databinding.dbk
===================================================================
--- openlaszlo/trunk/docs/src/developers/databinding.dbk        2008-01-18 
12:50:19 UTC (rev 7850)
+++ openlaszlo/trunk/docs/src/developers/databinding.dbk        2008-01-18 
12:51:10 UTC (rev 7851)
@@ -574,7 +574,7 @@
 <example role="live-example">
    <title>Ondata event</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$16.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$14.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -595,7 +595,7 @@
 <example role="live-example">
    <title>Using rerunxpath attribute</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$17.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$16.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -620,7 +620,7 @@
 <example role="live-example">
    <title>Visibility of datamapped views</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$18.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$17.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -643,7 +643,7 @@
 <example role="live-example">
    <title>Proper handling of data updates</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$19.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$18.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -662,7 +662,7 @@
 <example role="live-example">
    <title>Using datapointer's iterator methods</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$20.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$19.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -676,7 +676,7 @@
 <example role="live-example">
    <title>Using setPointer</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$21.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$20.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -690,7 +690,7 @@
 <example role="live-example">
    <title>Dereferencing datapaths</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$22.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$21.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -701,7 +701,7 @@
 <example role="live-example">
    <title>Datapath iteration</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$23.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$22.lzx"/></textobject> 
    </programlisting>
 </example>
 
@@ -715,7 +715,7 @@
 <example role="live-example">
    <title>Datapath iteration workaround</title>
    <programlisting language="lzx">
-   <textobject><textdata fileref="programs/databinding-$24.lzx"/></textobject> 
+   <textobject><textdata fileref="programs/databinding-$23.lzx"/></textobject> 
    </programlisting>
 </example>
 

Modified: openlaszlo/trunk/docs/src/developers/programs/databinding-$14.lzx
===================================================================
--- openlaszlo/trunk/docs/src/developers/programs/databinding-$14.lzx   
2008-01-18 12:50:19 UTC (rev 7850)
+++ openlaszlo/trunk/docs/src/developers/programs/databinding-$14.lzx   
2008-01-18 12:51:10 UTC (rev 7851)
@@ -1,28 +1,53 @@
-
-<canvas height="150" debug="true">
-  <debug x="150"/>
-  <dataset name="onion">
-    <layer order="1"><layer><layer>core</layer></layer></layer>
-  </dataset>
-
-  <view datapath="onion:/layer">
-     <simplelayout spacing="5"/>
-     <view width="${100 / this.data}" height="${100 / this.data}" 
-           bgcolor="0x09d055" datapath="@order" 
-           opacity="${Math.min(1, this.data / 3)}"/>
-    
-    <button text="Peel next layer">
-      <handler name="onclick">
-        with (parent.datapath) {
-          Debug.write(data)
-          if (!selectChild()) this.setAttribute('enabled', false) 
-          else setNodeAttribute('order', 
Number(p.parentNode.attributes['order']) + 1)
-         }
+<canvas height="200" >
+  <dataset name="numbers"/>
+  <datapointer name="top" xpath="numbers:/"/>
+  
+  <datapointer name="numptr">
+    <handler name="ondata" args="d">
+      // d is LzDataElement object 
+      result.update(d.nodeName)
+    </handler>
+  </datapointer>
+  
+  <simplelayout spacing="5"/>
+  <text>Type in a number and press the button or the Enter key</text>
+  <view>
+    <simplelayout spacing="10" axis="x"/>
+    <edittext name="input">
+      <handler name="onkeyup" args="k">
+        if ( k == 13 ) {
+          parent.bSend.compute();
+        }
       </handler>
+    </edittext>
+    <button name="bSend" text="Add">
+      <handler name="onclick" method="compute"/>
+        <method name="compute">
+        top.addNode(parent.input.getText())
+        var end = top.xpathQuery('*/last()')
+        numptr.setXPath('numbers:/*[' + end + ']')
+        parent.input.clearText()
+      </method>
     </button>
+</view>
+<view height="100" >
+    <text bgcolor="0xcecece" datapath="numbers:/*/name()"/>
+    <wrappinglayout axis="y" spacing="3"/>
   </view>
+  
+  <view>
+    <attribute name="sum" value="$once{0}"/>
+    <simplelayout axis="x"/>
+    <text><b>AVG: </b></text>
+    <text id="result" fgcolor="blue" fontstyle="bold">
+      <method name="update" args="v">
+        parent.sum += Number(v)
+        this.setText(parent.sum / top.p.childNodes.length)
+      </method>
+    </text>
+  </view>
 </canvas>
 <!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2007 Laszlo Systems, Inc.  All Rights Reserved.                   *
+* Copyright 2008 Laszlo Systems, Inc.  All Rights Reserved.                   *
 * Use is subject to license terms.                                            *
 * X_LZ_COPYRIGHT_END ****************************************************** -->


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

Reply via email to