aspose file tools*
The moose likes JSF and the fly likes h:outputLink link area in menu item too small - is there a workaround? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "h:outputLink link area in menu item too small - is there a workaround?" Watch "h:outputLink link area in menu item too small - is there a workaround?" New topic
Author

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

Tanya Ruttenberg
Ranch Hand

Joined: Jun 22, 2009
Posts: 40
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

Joined: Jun 25, 2001
Posts: 16228
    
  21

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?


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: h:outputLink link area in menu item too small - is there a workaround?