Image on Tab

UI Components for JSF
Post Reply
WolinDesign
Posts: 36
Joined: 21 Oct 2010, 22:47

01 Nov 2010, 21:47

Is there a way to place an image on each tab? Not in the body/content of the tab, in the tab itself. For instance, in the example in the showcase, rather than just having "Godfather Part I" in the first tab, is there a way to place an image instead of and/or next to the words? I've tried using <f:facet> and <f:attribute> tags without success. I see that the <p:tab> tag is rendered as an <a href..> tag inside an unordered list, but so far that hasn't helped me figure this out. Thanks in advance.
Sean - WDG
PF 2.2 JSF 2.0 NetBeans 6.9.1 Glassfish 3.0.1 Mojarra 2.0.3

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

01 Nov 2010, 22:03

There is no easy built-in way, hard way is to place an image on page and append it to the tab header with a jQuery one liner.

WolinDesign
Posts: 36
Joined: 21 Oct 2010, 22:47

01 Nov 2010, 22:06

Darn, I was hoping I was missing something obvious. Thanks for the quick response!
Sean - WDG
PF 2.2 JSF 2.0 NetBeans 6.9.1 Glassfish 3.0.1 Mojarra 2.0.3

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

01 Nov 2010, 22:11

I suggest trying the jquery approach if it is an important requirement, it would do the job. Then you can create your custom composite component and reuse it.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests