[Zope] dtml-tree based on a recursive SQL table

Philipp Auersperg zope@philosoft.at
Wed, 20 Oct 1999 10:28:15 +0200


Dear Martijn,
Thanks for the hint, there was the solution for my problem, for those who
are interested and did not scan the old archives the solution in short:

I have to add "id=CategoryID" to the tree tag, see dtml-snippet below,
otherwise I have to click two or more times on the branches of the tree to
expand.

<dtml-let categoryID="0">
<dtml-tree id= categoryID branches_expr="Category(parentid=categoryID)">
<dtml-var name><br>
</dtml-tree>
</dtml-let>

----- Original Message -----
From: Martijn Pieters <mj@antraciet.nl>
To: Philipp Auersperg <zope@philosoft.at>; Steen Suder
<CAB@kollegie6400.dk>; <zope@zope.org>
Sent: Tuesday, October 19, 1999 10:19 AM
Subject: Re: [Zope] dtml-tree based on a recursive SQL table


> At 03:48 19/10/99 , Philipp Auersperg wrote:
> >Steen,
> >Thanks for your answer, I did the following:
> >
> >0. define a SQL table named category:
> >    create table category(categoryID int primary key,parentID int,name
> >varchar(30))
> >
> >1. implement a Z SQL method named Category(parent):
> >     select *
> >     from Category where parentid=<dtml-var parentid>
> >
> >2. add the following DTML for example into index_html:
> >
> ><dtml-let categoryID="0">
> ><dtml-tree branches_expr="Category(parentid=categoryID)">
> ><dtml-var name><br>
> ></dtml-tree>
> ></dtml-let>
> >
> >now the tree expands and collapses fine but I have to click thw branches
2
> >to several times before they expand/collapse.
> >so dear zopers what is the trick?
>
> I can't believe that any of the older Zopistas on this list have not given
> a reference to the previous discussion on this subject, and its solution.
> Don't reinvent the wheel! Here is the complete discussion:
>
>    http://www.zope.org/pipermail/zope/1999-June/thread.html#6127
>
>
> --
> Martijn Pieters, Web Developer
> | Antraciet http://www.antraciet.nl
> | Tel: +31-35-7502100 Fax: +31-35-7502111
> | mailto:mj@antraciet.nl http://www.antraciet.nl/~mj
> | PGP: http://wwwkeys.nl.pgp.net:11371/pks/lookup?op=get&search=0xA8A32149
> ------------------------------------------
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://www.zope.org/mailman/listinfo/zope
>
> (Related lists - please, no cross posts or HTML encoding!
>
> To receive general Zope announcements, see:
> http://www.zope.org/mailman/listinfo/zope-announce
>
> For developer-specific issues, zope-dev@zope.org -
> http://www.zope.org/mailman/listinfo/zope-dev )