File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Vertucal Menu bar based on database values Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Vertucal Menu bar based on database values" Watch "Vertucal Menu bar based on database values" New topic
Author

Vertucal Menu bar based on database values

madhuri kh
Greenhorn

Joined: Aug 04, 2003
Posts: 8
I want to buils a verticle menu page for typical ecommerce site. But my menu is dynamic means the categories & leaf nodes are not fixed. I need to retrieve them from database. I searched a lot on google but most of those menus are written in javascript & DHTML & also have hardcoded menu item.
Could someone give some guidelines how to achieve this? We are using Struts framework for this project.
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
You say: most of those menus are written in javascript & DHTML & also have hardcoded menu item.
Yes. so what you can do in your application is generate the correct "hard-coded" JavaScript by reading the database. In the past I've done this quite succesfully. Try something like:

Note that I haven't compiled or run the above, so it's probably riddled with mistakes, but I hope you get the idea.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
madhuri kh
Greenhorn

Joined: Aug 04, 2003
Posts: 8
Thanx frank. My menu could have nested submenus whoes menue item are decided only after user clicks on categories. Is this possible with ur approach?
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Yes. The approach is just the same. Find one in Javascript with hard-coded values that does what you want, then write some code to generate the same Javascript code but with your values from your database query.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Vertucal Menu bar based on database values