Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need an idea on Navigation link selection color

 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65218
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Simpson Kumar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 261
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic