Author: lou
Date: 2007-12-20 07:38:45 -0800 (Thu, 20 Dec 2007)
New Revision: 7635
Modified:
openlaszlo/trunk/docs/src/developers/programs/databinding-$15.lzx
Log:
Change 20071220-lou-B by [EMAIL PROTECTED] on 2007-12-20 11:33:17 AST
in /Users/lou/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: replace Example 37.13 in the Data access and binding chapter
Bugs Fixed: LPP-5300
Technical Reviewer: (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Details: revert the example code to the one in r3.4
Tests: verify visually
Modified: openlaszlo/trunk/docs/src/developers/programs/databinding-$15.lzx
===================================================================
--- openlaszlo/trunk/docs/src/developers/programs/databinding-$15.lzx
2007-12-20 15:37:35 UTC (rev 7634)
+++ openlaszlo/trunk/docs/src/developers/programs/databinding-$15.lzx
2007-12-20 15:38:45 UTC (rev 7635)
@@ -1,53 +1,27 @@
+<canvas height="150" debug="true">
+ <debug x="150"/>
+ <dataset name="onion">
+ <layer order="1"><layer><layer>core</layer></layer></layer>
+ </dataset>
-<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();
- }
+ <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)
+ }
</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.setAttribute('xpath', '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.setAttribute('text', parent.sum / top.p.childNodes.length)
- </method>
- </text>
- </view>
</canvas>
+
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2007 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins