<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hello List,<br>
<br>
thank you for the helping. <br>
<br>
I've tested the whole day along the ids and the behaviour is still the
same.<br>
They are different. &lt;dtml-var id&gt; proofs.<br>
In the html-sourcecode I've seen 2 things:<br>
1st:&nbsp; The Name of the Anchor is the same for each branch<br>
2nd: The Href for all branches of one layer is exactly the same, but
different from the other layers.<br>
<br>
Layer 1:<br>
&lt;a name="Tm9uZQ=="
href="show_html?tree-c=eJyLVneEAnf9ZFt1HQX1kFzL0qhAW1v1WABnawdT#Tm9uZQ=="&gt;<br>
<br>
Layer 2:<br>
&lt;a name="Tm9uZQ=="
href="show_html?tree-e=eJyLVneEAnf9ZFt1HQX1kFzL0qhAW1R2LADSHgqB#Tm9uZQ=="&gt;<br>
<br>
The dtml-code now looks like:<br>
&lt;dtml-tree branches="getBranches"&gt;<br>
&nbsp;&nbsp;&nbsp; branch:<br>
&nbsp;&nbsp; id: &lt;dtml-var id&gt; &lt;dtml-var title_or_id&gt;<br>
&lt;/dtml-tree&gt;<br>
<br>
And the Product-Code:<br>
class StaticTestBranch(OFS.SimpleItem.Item, Persistent):<br>
&nbsp;&nbsp;&nbsp; def __init__(self, id, children):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.id = id<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.children = children<br>
<br>
&nbsp;&nbsp;&nbsp; def getBranches(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.children<br>
<br>
&nbsp;&nbsp;&nbsp; def getId(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return self.id<br>
<br>
<br>
class tstProd .<br>
<br>
def getBranches(self):<br>
&nbsp;&nbsp;&nbsp;&nbsp; e1 = StaticTestBranch("e1", None)<br>
&nbsp;&nbsp;&nbsp;&nbsp; e2 = StaticTestBranch("e2", None)<br>
&nbsp;&nbsp;&nbsp;&nbsp; e3 = StaticTestBranch("e3", None)<br>
&nbsp;&nbsp;&nbsp;&nbsp; s1 = StaticTestBranch("s1", [e1, e2])<br>
&nbsp;&nbsp;&nbsp;&nbsp; s2 = StaticTestBranch("s2", [e3])<br>
&nbsp;&nbsp;&nbsp;&nbsp; v1 = StaticTestBranch("v1", [s1])<br>
&nbsp;&nbsp;&nbsp;&nbsp; v2 = StaticTestBranch("v2", [s2])<br>
&nbsp;&nbsp;&nbsp;&nbsp; branches = [v1, v2]<br>
&nbsp;&nbsp;&nbsp;&nbsp; return branches<br>
<br>
<br>
Do you have an idea, what I still make wrong?<br>
<br>
Again, many thanks in advance,<br>
Ulla. <br>
<br>
<br>
Dieter Maurer wrote:<br>
<blockquote type="cite"
 cite="mid16940.42380.758968.986114@gargle.gargle.HOWL">
  <pre wrap="">Ulla Theiss wrote at 2005-3-7 12:41 +0100:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Now, I've derived my class TestBranch from "OFS.SimpleItem", which does 
have a method "getId()" and from "Persistent". The behaviour is much 
better and reproducible - but still not correct: Clicking on one 
plus-sign all the plus-signs of the chosen layer change to minus and are 
expanded, nevertheless the branch belongs to the chosen sign or not.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Now, you should give your objects different ids and you are
done...

When you do not set the id, it is ''. And such an id
is not differentiating (as you observe from your "dtml-tree").

  </pre>
</blockquote>
</body>
</html>