users@woodstock.java.net

Re: Tab Component not using style or styleClass (resend)

From: Venkatesh Babu <Venkatesh.M_at_Sun.COM>
Date: Thu, 20 Dec 2007 12:20:52 +0530

The tab renderer inherits from the hyperlink's renderer.
Hence, the tab renderer is essentially rendering an HTML "<a>" tag.
I am not sure whether you can actually apply a background image to the
"<a>" tag.

However, if you look at the generated HTML, You would see that the tab
is essentially rendered
within a <td> table column of the tabset.

<td>
<a id="form:tabset:tabOrderableList" class="Tab1Lnk_sun4"
onclick="return webui.suntheme.hyperlink.submit(this, 'form', null);"
href="#"> Orderable List </a>
</td>

So, you could try setting the styleclass on the tabSet component with the background style being set on the "td" element.



-Venky
Brian.Dahl_at_expeditors.com wrote:
>
> (Sorry for the resend spam... I forgot the subject)
>
> Hello,
>
> I’m having a problem with the tab component. I have a requirement to
> be able to place
> images into a tab itself, next to the text (in order to show an “at a
> glance” sort of status).
> Unfortunately Woodstock doesn’t seem to support this sort of action
> right out of the box.
> The way around this we came up with was to style the individual tabs
> and just do some
> css work with the background-image property. This brought up its own
> problem though.
> It appears that the tab component ignores both the style and
> styleClass attributes.
>
> Right now my page has some code that looks like this:
>
> <webuijsf:tabSet selected="tab1" mini="true" lite="true">
> <webuijsf:tab id="tab1" text="Im a tab!" styleClass="someClass"
> style=”background-color:purple”>
> Stuff in the tab
> </webuijsf:tab>
> ..
> </webuijsf:tabSet>
>
> When I load the page, everything looks as though no style has been
> applied. I can also
> search the source for the class and attributes and not locate them.
> Now… if I move the
> attributes up to the tabSet level, so it looks like this…
>
> <webuijsf:tabSet selected="tab1" mini="true" lite="true"
> styleClass="someClass" style=”background-color:purple”>
> <webuijsf:tab id="tab1" text="Im a tab!">
> Stuff in the tab
> </webuijsf:tab>
> ..
> </webuijsf:tabSet>
>
> …everything in the tab section EXCEPT the tabs themselves show up with
> the expected
> attributes. I can also search the source and find someClass defined as
> a class and my
> background-color definition.
>
> According to the tld docs, style and styleClass are both attributes of
> the tab component…
> but it doesn’t seem like they are rendered.
>
> Any suggestions? Also if there’s a “right” way to put an image on a
> tab, that would be great too.
>
> Thank you,
> Brian