[Laszlo-checkins] r13038 - in openlaszlo/trunk/lps/components/incubator: opttree test/opttree
bargull@openlaszlo.org
bargull at openlaszlo.org
Tue Feb 24 08:34:27 PST 2009
Author: bargull
Date: 2009-02-24 08:34:24 -0800 (Tue, 24 Feb 2009)
New Revision: 13038
Modified:
openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx
openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx
openlaszlo/trunk/lps/components/incubator/test/opttree/test.lzx
openlaszlo/trunk/lps/components/incubator/test/opttree/treenode.lzx
Log:
Change 20090224-bargull-clG by bargull at dell--p4--2-53 on 2009-02-24 15:27:14
in /home/Admin/src/svn/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: presentation type attribute coercion breaks opttree
New Features:
Bugs Fixed: LPP-7803 (opttree example doesn't work)
Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
baseopttreenode.lzx:
- "dopen" attribute-type wasn't specified so ExpressionPresentationType coerced the value to a boolean
-> this broke the constraint for "open" which expected a string value
I've changed the attribute-type for "dopen" to boolean just to reduce possible (?) confusion
- "ddepth" same story as for "dopen", just replace boolean with number...
- also added "checkChildren" method which is expected in opttree ("beginDrag" and "endDrag")
opttree.lzx:
- call "clearSelection()" instead of "select(null)" to clear the current selection (otherwise a nullptr exception was thrown in lz.dataselectionmanager)
treenode.lzx:
- only select node when clicked, not when the "open" attribute changed
test.lzx:
- override "select()" in order to provide the expected "selection" attribute
Tests:
run opttree test application
Modified: openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx 2009-02-24 15:48:32 UTC (rev 13037)
+++ openlaszlo/trunk/lps/components/incubator/opttree/baseopttreenode.lzx 2009-02-24 16:34:24 UTC (rev 13038)
@@ -1,16 +1,16 @@
<library>
<class name="baseopttreenode">
<!--- @keywords private -->
- <attribute name="dopen" value="$path{ parent.openattrpath }"/>
+ <attribute name="dopen" value="$path{ parent.openattrpath }" type="boolean"/>
<!--- A boolean value representing whether or not this node
is open. -->
- <attribute name="open" value="${ dopen == 'true' }"/>
+ <attribute name="open" value="${ dopen }"/>
<!--- @keywords private -->
- <attribute name="ddepth" value="$path{ parent.depthattrpath }"/>
+ <attribute name="ddepth" value="$path{ parent.depthattrpath }" type="number"/>
<!--- A 0-based depth number that indicates the depth of this
element in the tree. -->
- <attribute name="depth" value="${ Number( ddepth ) }"/>
+ <attribute name="depth" value="${ ddepth }"/>
<!--- If true, this element is selected -->
<attribute name="highlight" value="null"/>
@@ -50,6 +50,9 @@
}
</handler>
+ <method name="checkChildren" >
+ // abstract method
+ </method>
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
Modified: openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx 2009-02-24 15:48:32 UTC (rev 13037)
+++ openlaszlo/trunk/lps/components/incubator/opttree/opttree.lzx 2009-02-24 16:34:24 UTC (rev 13038)
@@ -92,7 +92,11 @@
be open. Open elements display their children; not open elements
do not.-->
<method name="select" args="el">
- selman.select( el );
+ if (el != null) {
+ selman.select( el );
+ } else {
+ selman.clearSelection();
+ }
</method>
<!--- The keyboard nav highlighted baseopttreenode or null. This
Modified: openlaszlo/trunk/lps/components/incubator/test/opttree/test.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/test/opttree/test.lzx 2009-02-24 15:48:32 UTC (rev 13037)
+++ openlaszlo/trunk/lps/components/incubator/test/opttree/test.lzx 2009-02-24 16:34:24 UTC (rev 13038)
@@ -31,13 +31,19 @@
<view height="${ immediateparent.height - y }" width="100%" clip="true">
<opttree id="gOptTree" datapath="dsTreeData:/root"
- nodepath="*" nodeclass="treenode"/>
+ nodepath="*" nodeclass="treenode">
+ <attribute name="selection" value="null" />
+ <method name="select" args="el" override="true"><![CDATA[
+ super.select(el);
+ this.setAttribute("selection", el && el.datapath.p);
+ ]]></method>
+ </opttree>
<scrollbar/>
</view>
</window>
</canvas>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008-2009 Laszlo Systems, Inc. All Rights Reserved. *
* Use is subject to license terms. *
* X_LZ_COPYRIGHT_END ****************************************************** -->
<!-- @LZX_VERSION@ -->
Modified: openlaszlo/trunk/lps/components/incubator/test/opttree/treenode.lzx
===================================================================
--- openlaszlo/trunk/lps/components/incubator/test/opttree/treenode.lzx 2009-02-24 15:48:32 UTC (rev 13037)
+++ openlaszlo/trunk/lps/components/incubator/test/opttree/treenode.lzx 2009-02-24 16:34:24 UTC (rev 13038)
@@ -28,6 +28,7 @@
<handler name="onclick">
<![CDATA[
parent.setOpen( datapath.p, !open );
+ parent.select( this );
]]>
</handler>
@@ -37,7 +38,6 @@
var p = datapath.p;
if ( !p ) return;
var cn = p.childNodes;
- parent.select( this );
if ( !cn || !cn.length ){
gDataMan.loadAdditionalTreeData( p );
}
@@ -47,7 +47,7 @@
</class>
</library>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
-* Copyright 2006, 2008 Laszlo Systems, Inc. All Rights Reserved. *
+* Copyright 2006, 2008-2009 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