in reply to collapsable tree

Probably your best bet would be to assign each of your items in the tree a unique identifier, and then in your html keep the info of which branches are expanded. Like a hidden field that looks something like "00,05,0A,2B" something like that, or else maintain a state in a session on the system. Then you link the items to change state with something like an expand or collapse command containing its identifier. Or you could put it in all the links, thought that would make your html much longer...
?expanded=00,05,0A,2B&collapse=2B
of course, I'm sure there are many other ways to do it.
                - Ant

Replies are listed 'Best First'.
Re: Re: collapsable tree
by jeroenes (Priest) on May 17, 2001 at 17:46 UTC
    The 'session' state could be implemented in a CGI-way. Give all branches an ID, and give them to states: expanded (0) or collapsed (1). This way, you can address 32 branches in a long integer. So for every 32 branches you assign one number. You can pack/unpack these numbers to a CGI-compatible string with CGIpack. This allows the branches to be coded in a compact url.

    In the script, you unpack the url to a series of numbers, which are translated with unpack to a series of bits. With substr you pick the bit for the particular branch, to expand or collapse.

    Jeroen
    "We are not alone"(FZ)