DBTreeView is cool, but not doing what I want. I have a hierarchy and need to be able to move things within the hierarchy just like you might do with a filesystem tree. I have the methods to do this but each time I move something in the tree, the tree fails to refresh properly. It leaves an extra folder without label in the place of the one moved. Wierd.
I have a bean init method tied to an onload method, but it doesn’t seem to have an effect unless I go in and out of designer. Of course that while not at all practical also closes up the tree so isn’t what I want anyway. Nothing else seems to clean it up.
The control over the DBTreeView plugin is limited.
I don’t know what your needs are in a tree but maybe my HTMLTree module would help.
At least it gives you full control over the order of things (the tree is an array) and the state (expanded/collapsed) of nodes.
See http://forum.servoy.com/viewtopic.php?t=3847
Thanks, Robert. I checked out your tree module last night. It’s very cool. Nice work. I did notice an odd refresh glitch with it where every time I opened and closed a node, it flashes the entire tree open. I assumed that was an html interpreter issue and nothing could be done about it. Do you have similar problems?
What I really need is a tree view that works refreshes flawlessly and looks professional. It needs to allow an unlimited number of nodes and leaves. It needs to provide support for sorting as well as controlling which noodes are opened and closed programmatically. It also needs to be able to show different icons for different record types - like you see in the Servoy Editor. I also want the ability to have a leaf show up under more than one node to allow thing to be classified and looked for in several ways.
I assume that the best way to get what I want would be to write a bean that extends the jtree package, but I haven’t gotten that far yet. Do you think your HTML based tree module could be extended to meet these requirements?
So how do you get the different icons? All I get is folders opened and closed. I can change the LAF, but not a leaf’s icon. My data just uses a parent Key for each record.
How can I get the same leaf or node to show up under more than one parent node?
Where image is a field in de database that you use to set the node names.
On your refresh issue, you already have a method set to execute when clicking a node:```
elements.bean.setCallBackInfo(globals.taskNodeSelected, ‘value_to_return’);
bob cart:
Thanks, Robert. I checked out your tree module last night. It’s very cool. Nice work. I did notice an odd refresh glitch with it where every time I opened and closed a node, it flashes the entire tree open. I assumed that was an html interpreter issue and nothing could be done about it. Do you have similar problems?
When you select a node, expand or collapse a node the whole tree is redrawn. You gave to remember it’s in fact nothing more than a web page.
Too bad we can’t use DHTML (javascript).
The flashing is hardly noticeable on Mac OS X and Linux. With Windows XP on my old PC I do see the tree building up. But that might be old PC.
bob cart:
What I really need is a tree view that works refreshes flawlessly and looks professional. It needs to allow an unlimited number of nodes and leaves. It needs to provide support for sorting as well as controlling which noodes are opened and closed programmatically. It also needs to be able to show different icons for different record types - like you see in the Servoy Editor. I also want the ability to have a leaf show up under more than one node to allow thing to be classified and looked for in several ways.
I assume that the best way to get what I want would be to write a bean that extends the jtree package, but I haven’t gotten that far yet. Do you think your HTML based tree module could be extended to meet these requirements?
Well most of that can be done with the DBTreeView bean as Marcel explained.
The HTMLTree module can be expanded to support custom icons though.
I got a custom image to show, though that really wasn’t what I’m after. I’d really like to have leafs not show an open or closed , i.e. ‘+’ or ‘-’ since they don’t contain anything. Does this have to do with the two types of set relation methods, i.e. setNRelationName and setMRelationName?
We are about to release our Hierarchical Tree View Bean.
This does exactly what you are looking for wrt creating a hierarchy within your records.
What is allows you to do is visually and dynamically build a hierarchy of records from an exisitng table without modifying the existing table.
It is a bean which you configure once onRecordSelection, and then the user has the ability to add/remove/edit the existing records from the hierarchical tree view which the bean presents.
This bean is nothing like Servoy’s ‘dbtreeviewbean’.
It does not perform any relational functions based on your defined Relationships.
Neither does it fire events or anything of the sort (although I could easily add method-fire support if you needed it).
We will post to Plugins and Beans as soon as the release is pushed up to our Update Server.