File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes add images and text in rich:tab header Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "add images and text in rich:tab header" Watch "add images and text in rich:tab header" New topic

add images and text in rich:tab header

Sachin Yewale

Joined: Feb 02, 2012
Posts: 21
Hi friends ,
I want to create a tab like menu in jsf 2.0.
I am using rich:tab for this. but in this component there is attribute label which is used to give name to header,but i want to use both name and icon for the header name. Do any one have idea how to do that?

thanks in advance
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952

That particular component doesn't appear to support images. It may be possible to attach an icon using the "style/styleClass" attribute as a CSS operation, but if that doesn't work, you'll have to find an alternative tabPanel solution.

Customer surveys are for companies who didn't pay proper attention to begin with.
J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
You actually can do this, we do it in our application to add an icon to close that tab. You can put it inside a label facet like this:

You can put whatever you want in the label facet. We have text and an image.
Brendan Healey
Ranch Hand

Joined: May 12, 2009
Posts: 218
Well I never, useful to know, thanks J Miller.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15952

I kinda knew, since I think I've actually done it. But I'm reluctant to volunteer on stuff in header facets, since the exact content and format of what goes into a facet tends to vary with the tag being faceted.

Anyway, now it's official. Problem Solved!
I agree. Here's the link:
subject: add images and text in rich:tab header
Similar Threads
Action does not work inside rich:popupPanel
rich tabpanel : first rich tab not loaded with focus with first tab
How to display text & image in richfaces tab
Do I need a backing bean to get the character length of the contents in a text-area?