I have the same problem.Please let me know if you find a solution...would really appreciate it.
Originally posted by Sharon:
I would appreciate if any one can help me locate open source code for a java tree that is generated from a database. This should be a part of servlet and should be coded without using swing preferably.
An example would be great!
For one of our client I had developed a tree structure menu. Only thing it was not colapsable at the folder level.
The idea is to have a database table with the menu_id, menu_name, menu_url, parent_id,menu_type,etc.
have a bean, plsql code run through this table to generate the UI placing the menu_names as the text and creating a hyperlink using the url. For the tree structure the parent_id & the menu_type are useful to place a particular menu within the other. I had given the menu_type as Folder/Document. A folder will have children. So the logic loops again to find the sub-folders or documents.
So I had a JSP, A Bean and my databse table and I could generate a tree structure. This ofcourse was role based, i.e. when the user logs in , the application determines his role and generates the options that he has in the form of a tree.
The code is kind of proprietory, so I will not be able to share the same. But this is essentially the logic that I used.
Hope this helps.
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.