aspose file tools*
The moose likes JSF and the fly likes How to display text & image in richfaces tab Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "How to display text & image in richfaces tab" Watch "How to display text & image in richfaces tab" New topic

How to display text & image in richfaces tab

mark weatherill

Joined: Jan 21, 2006
Posts: 6

I would like to include both a text label and image of a close button in the header of a richfaces tab component.
I have tried including a
<f:facet name="label">
<h:graphicImage value="closeButton.gif"/>
in the <rich:tab> tag which also has a label attribute, but only the image data gets displayed, not both.
Could someone please suggest a way to include both text and image in a richfaces tab component?

Mark Weatherill.
Ramnath Natarajan

Joined: Mar 01, 2005
Posts: 10
Did you find a solution for this???

Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139

<f:facet name="label">
<h:graphicImage value="closeButton.gif"/> Your Text Here

“Any fool can write code that a computer can understand. Good programmers write code that humans can understand. ”<br>
-Martin Fowler
karthigeyan narayanamurthy

Joined: Jun 18, 2008
Posts: 1
Try this !!!

<f:facet name="label">
<h:graphicImage value="closeButton.gif"/>
<hutputLabel value="Your Text Here"></hutputLabel>
Tom Eller

Joined: Jun 24, 2008
Posts: 1
I tried the panelGroup approach and still get neither text nor image in the tab. Is this a "newer" feature perhaps? I only have RichFaces 3.0.0.

(Tomcat 6.0.16, JDK 1.5.0_15, JSF 1.2_04-b07)
mark louis

Joined: Nov 10, 2009
Posts: 1

<h:panelGrid columns="2">

in your facet.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Not sure if 3, changed but in Richfaces 4, "label" was changed to "header".

I was able to get this to work using richfaces 4.2.2 final!

J Miller
Ranch Hand

Joined: Oct 21, 2010
Posts: 67
I actually answered almost this exact same question yesterday on this post:

You can do exactly what I said there, but also put an outputText in the label facet. This is how we're currently doing this in my project. The code sample I provided was for Richfaces 3.3.3, so it may have changed in 4 as William said. Same principle should work though.
subject: How to display text & image in richfaces tab