[Zope] dtml-tree: wrong branchesexpanded/collapsed

Ulla Theiss u.theiss at eurodata.de
Tue Mar 8 16:06:07 EST 2005


Hello List,

thank you for the helping.

I've tested the whole day along the ids and the behaviour is still the same.
They are different. <dtml-var id> proofs.
In the html-sourcecode I've seen 2 things:
1st:  The Name of the Anchor is the same for each branch
2nd: The Href for all branches of one layer is exactly the same, but 
different from the other layers.

Layer 1:
<a name="Tm9uZQ==" 
href="show_html?tree-c=eJyLVneEAnf9ZFt1HQX1kFzL0qhAW1v1WABnawdT#Tm9uZQ==">

Layer 2:
<a name="Tm9uZQ==" 
href="show_html?tree-e=eJyLVneEAnf9ZFt1HQX1kFzL0qhAW1R2LADSHgqB#Tm9uZQ==">

The dtml-code now looks like:
<dtml-tree branches="getBranches">
    branch:
   id: <dtml-var id> <dtml-var title_or_id>
</dtml-tree>

And the Product-Code:
class StaticTestBranch(OFS.SimpleItem.Item, Persistent):
    def __init__(self, id, children):
        self.id = id
        self.children = children

    def getBranches(self):
        return self.children

    def getId(self):
        return self.id


class tstProd .

def getBranches(self):
     e1 = StaticTestBranch("e1", None)
     e2 = StaticTestBranch("e2", None)
     e3 = StaticTestBranch("e3", None)
     s1 = StaticTestBranch("s1", [e1, e2])
     s2 = StaticTestBranch("s2", [e3])
     v1 = StaticTestBranch("v1", [s1])
     v2 = StaticTestBranch("v2", [s2])
     branches = [v1, v2]
     return branches


Do you have an idea, what I still make wrong?

Again, many thanks in advance,
Ulla.


Dieter Maurer wrote:

>Ulla Theiss wrote at 2005-3-7 12:41 +0100:
>  
>
>>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.
>>    
>>
>
>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").
>
>  
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.zope.org/pipermail/zope/attachments/20050308/9d21a594/attachment.htm


More information about the Zope mailing list