Here is an example using the tree code that is in the Laszlo Reference.
You will note that all I did was pull the datapath attribute out of the
last tree node and used it as a tag. When you run this code it creates
duplicate nodes exactly as I first experienced. Let me know if you are
experiencing the same behavior I am and I have no problems opening up a
bug for this.
<canvas width="450" height="250">
<include href="lz/tree.lzx"/>
<dataset name="ancestors">
<hobbit name="Frodo">
<hobbit name="Drogo">
<hobbit name="Fosco" grandparent="true"/>
<hobbit name="Bolger, Ruby" grandparent="true"/>
</hobbit>
<hobbit name="Brandybuck, Primula">
<hobbit name="Brandybuck, Gorbadoc" grandparent="true"/>
<hobbit name="Took, Mirabella" grandparent="true"/>
</hobbit>
</hobbit>
</dataset>
<!-- data replicated tree -->
<view width="200" height="200">
<tree datapath="ancestors:/" icon="null" showroot="false">
<tree icon="null" text="$path{'@name'}"
isleaf="$path{'@grandparent'}">
<datapath xpath="*"/>
</tree>
</tree>
</view>
</canvas>
________________________________
From: Henry Minsky [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 29, 2007 5:56 PM
To: David Buckler
Cc: Laszlo
Subject: Re: [Laszlo-user] Dataset as an Attribute and Tag Error
On Nov 29, 2007 6:53 PM, David Buckler <[EMAIL PROTECTED]> wrote:
>
>
> I do stuff like this in a many places in our application:
>
> <hbCol height="${ parent.height}" datapath="ds_gridData:/grid/column">
> <datapath pooling="true"/>
> </hbCol>
>
In July of this year, I made the following change, which was to fix some
other problem which came about when I moved some of the
datapath initialization code from runtime to compile time, to make it
more efficient. This seems to indicate that the <datapath> tag will
override any
datapath attribute. I guess there needs to be a warning in the compiler
if both are seen in a node!
r5735 | hqm | 2007-07-20 18:03:44 -0400 (Fri, 20 Jul 2007) | 32 lines
Changed paths:
M
/openlaszlo/branches/legals/WEB-INF/lps/server/src/org/openlaszlo/compil
er/NodeModel.java
Change 20070720-hqm-2 by [EMAIL PROTECTED] on 2007-07-20 16:56:27 EDT
in /cygdrive/c/users/hqm/openlaszlo/legals4/WEB-INF/lps/server/src
for
http://svn.openlaszlo.org/openlaszlo/branches/legals/WEB-INF/lps/server/
src
Summary: datapath attribute was conflicting with <datapath> element
New Features:
Bugs Fixed: LPP-3482, LPP-3894
Technical Reviewer: ptw (pending)
QA Reviewer: (pending)
Doc Reviewer: (pending)
Documentation:
Release Notes:
Details:
This was a regression from LPP_3894. There was a fix which made sure to
ignore inherited datapath attributes when there was a <datapath> child
node
found. That fix was inside of LzFixTags, which later was removed
completely.
Fix moved the proper line of code to the compiler.
> As you can see there is a datapath definatition as an attribute but I
also
> want to have pooling which means I have to also have a datapath tag.
Now
> this used to work in 3.x.x and it worked in 4.0.3 but in recent
> versions(4.0.5, 4.0.6, and 4.0.7) I have confirmed this no longer
works.
> When you go to the debugger in 4.0.7, and look at the datapath of
hbCol for
> example, all you see is the attribute pooling set to true and nothing
about
> ds_gridData. Can anyone confirm or deny that they see similar
behavior?
I think you will need to set the datapath using the "xpath" attribute of
the <datapath> element, and omit the datapath attribute on the view.
>
> On what I believe is a similar note, I was trying to fix a datapath
with a
> tree and the original code was:
>
> <tree datapath="*" text="$path{'@name'}"
> isleaf="${this.datapath.getNodeName() != 'category'}"
x="${(this.isleaf) ?
> -32 : 0}" >
>
> However I needed to latch onto the onclone event of the replication
manager
> so I went:
>
>
> <tree text="$path{'@name'}" isleaf="${this.datapath.getNodeName() !=
> 'category'}" x="${(this.isleaf) ? -32 : 0}" >
> <datapath xpath="*">
> <method event="onclones">
>
> The strangest thing happen in that the tree then duplicated all the
leaf
> nodes. Any ideas?
>
> David
I don't have time to look at that right now, but maybe can you file a
bug in JIRA, with a small self contained test case?
That will ensure this doesn't get lost.
Thank you.
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]