aspose file tools*
The moose likes JSF and the fly likes Menu link image change when I click the button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Menu link image change when I click the button" Watch "Menu link image change when I click the button" New topic
Author

Menu link image change when I click the button

ToT Ty
Greenhorn

Joined: Oct 27, 2011
Posts: 2
So I have these graphic buttons on my menu. They have 2 versions of them, 1 active and 1 inactive image. When I click on for instance the "forum" button, I would like my "inactive" image on that link, to become "active", and the "Index active" button, to become inactive.

This is how the buttons look in the menu:


When I click that link I want the
resources/graphics/Button-Forum-inactive.jpg
to become
resources/graphics/Button-Forum-active.jpg

and the currently used Index-active.jpg to become Index-unactive.jpg

Is there any "easy" way to do this?
J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 63
I've accomplished things like this before using the "rendered" attribute tied to a boolean value in a backing bean. For example, you could say:



That's how I've accomplished this before.

Hope that helps
ToT Ty
Greenhorn

Joined: Oct 27, 2011
Posts: 2
Yes! That is perfect. A great way to solve it. I am having a few troubles making the myBean tho
 
 
subject: Menu link image change when I click the button
 
Similar Threads
Make Active n Inactive button using JavaScript
h:outputLink link area in menu item too small - is there a workaround?
Associating button with text field
Change Image when Link is Active
blue borders are showing on image link in jsf