Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

h:outputLink link area in menu item too small - is there a workaround?

 
Tanya Ruttenberg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of my pet peeves regarding h : outputLink inside a menu item is that the area where the link is active is restricted to the text, rather than the full area of the selection.

For example I have this code



Each menu item, when selected, is highlighted in a rectangle that spans the width of the drop-down menu.
The link rendered by h : outputLink is only active when you mouse over the text of the selection, NOT the whole selection.

This drives me crazy. Is there a workaround to this problem? I have concluded, in testing, that my link was non-functional, until I realized that the mouse was not over the text of the selection in which case the link worked fine.

Tanya
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18152
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ultimately, that's because that's how HTML works and RichFaces is generating HTML.

To make it work the way you describe you'd have to use a combination of CSS and JavaScript to sensitize an area to mouse events to handle the highlighting and click actions. Which would probably be better done using raw HTML and not RichFaces, since RichFaces has a fairly complex infrastructure that you should only meddle with if you know what it's doing.

I don't remember if any of the alternative menu frameworks are more like you want. Maybe Tomahawk's jscookmenu?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic