File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Android Security Essentials Live Lessons this week in the Android 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
Author

How to display text & image in richfaces tab

mark weatherill
Greenhorn

Joined: Jan 21, 2006
Posts: 6
Folks

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"/>
</f:facet>
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?
Thanks,

Mark Weatherill.
Ramnath Natarajan
Greenhorn

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

RamnathN
Venkat Sadasivam
Ranch Hand

Joined: May 10, 2008
Posts: 139
Try

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


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

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

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

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
Greenhorn

Joined: Nov 10, 2009
Posts: 1
try

<h:panelGrid columns="2">
col1
col2
</h:panelGrid>

in your facet.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 860

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!



WP
J Miller
Ranch Hand

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

http://www.coderanch.com/t/584029/JSF/java/add-images-text-rich-tab

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to display text & image in richfaces tab
 
Similar Threads
validation of inputText in rich:dataTable
rich:dropSupport not working
Submit dataTable fields
problem with datatable binding attribute
Richfaces Scrollable Datatable with filtermethod not working