wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes Need an idea on Navigation link selection color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Need an idea on Navigation link selection color" Watch "Need an idea on Navigation link selection color" New topic
Author

Need an idea on Navigation link selection color

Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi,

I have a page with left side navigation menu, in this menu we are displaying some categories from the database, each one is linking to corresponding page. here When we clink on any link, that name with the link should be changed. that means the user can identify that he is in that particular category's page.

If you see this link
selected category with color change, you can get the idea what I mean to say. In this page the "kids" is selected (forget about the underneath 3 subcategories), here I want to get the idea how dynamically changed the "kids" color when we click on this.


Thanks,
Kumar
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60781
    
  65

Please take the time to choose the correct forum for your posts. This forum is for questions on JSP.

For more information, please read this.

This post has been moved to a more appropriate forum.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Please see the following code which I have. i.e. the code behind what I sent you the link.



here class="current" is given to Kids category, that means the kids is changed the color. If I click on the "Craft", then how to set the class="current" to this?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Well you would have to add the class="current" to that link.

Build functionality in your Java code that generates the menu and spit out what you need when you are on that page.

Eric
Simpson Kumar
Ranch Hand

Joined: Mar 19, 2008
Posts: 261
Hi Eric,

What I'm thinking is, I will create a java POJO class with (name and className fields) and I will create the new object for each field( Craft, Kids, etc) in the list returned from db.
Ex: -
in the Action class

Then I use this listForJSP list object to display the categories with the corresponding style class like



is that works?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need an idea on Navigation link selection color
 
Similar Threads
passing parameters to included jsp file
Interesting tiles/struts making a menu question
JSF navigation problem
JColorChooser and StyledEditorKit foreground
updating value in bean 2 from bean 1