users@woodstock.java.net

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

From: Venkatesh Babu <Venkatesh.M_at_Sun.COM>
Date: Fri, 28 Dec 2007 17:39:08 +0530

I see what you are saying..
The style doesnt get rendered for selected tabs.
The selected tab doesnt seem to act as an hyperlink and gets rendered as
plaintext.
I have attached a screen shot which shows what i am saying.

Please file a bug.

-Venky
Brian.Dahl_at_expeditors.com wrote:
>
> I tried what you said and yes, I saw a red rendered link... but your
> example is missing the tabset
> tags.
>
> <webuijsf:tab id="tab4" text="Three" style="color:red">
> <webuijsf:staticText text="Contents on page 3"/>
> <webuijsf:button text="Button4"/>
> </webuijsf:tab>
>
> Will show only a red hyperlink that says "Three." Add the rest of the
> tabset tag..
>
> <webuijsf:tabSet>
> <webuijsf:tab id="tab4" text="Three" style="color:red">
> <webuijsf:staticText text="Contents on page 3"/>
> <webuijsf:button text="Button4"/>
> </webuijsf:tab>
> </webuijsf:tabSet>
>
> And now we're back to what I mentioned earlier. The "Three" tab
> renders without any style
> associated to it, and searching for "color:red" in the source yields
> no results.
>
>
> Thanks,
> Brian Dahl
>
> ------------------------------
> Expeditors
> Developer
> CHQ - IS
> 206.674.3400 x3733
>
>
> *Venkatesh Babu <Venkatesh.M_at_Sun.COM>*
> Sent by: Venkatesh.M_at_Sun.COM
>
> 12/26/2007 02:33 AM
> Please respond to
> users_at_woodstock.dev.java.net
>
>
>
> To
> users_at_woodstock.dev.java.net
> cc
>
> Subject
> Re: Tab Component not using style or styleClass (resend)
>
>
>
>
>
>
>
>
>
> Hi Brian,
>
> I just tried a simple example like this
> <webuijsf:tab id="tab4" text="Three" style="color:red">
> <webuijsf:staticText text="Contents on page 3"/>
> <webuijsf:button text="Button4"/>
> </webuijsf:tab>
>
> And the output i could see was:
> <td>
> <a id="tabsexample:tabset2:tab4" class="Tab1Lnk_sun4 TabPad_sun4"
> style="color: red;" onclick="return
> webui.suntheme.hyperlink.submit(this, 'tabsexample', null);" href="#">
> Three
> </a>
> </td>
>
> So, the style is being rendered for me. I can see the particular tab
> text being rendered in red color.
> Could you re-try your example again?
>
>
> -Venky_
> __Brian.Dahl_at_expeditors.com_ <mailto:Brian.Dahl_at_expeditors.com> wrote:
>
> Thanks for the reply
>
> Setting the style of the td tag won't really help me, because I need
> to be able to
> dynamically set the style from the backing bean, and I need to be able
> to make
> each tab look different.
>
> And regardless of whether or not you can style the background of an
> anchor tag,
> you should be able to style something. The TLD Dogs say style and
> styleClass
> are both valid attributes for the tab woodstock object... but if you
> do something like this:
>
> <webuijsf:tab id="aTab" text="someStuff" style="color:green">
>
> Nothing turns green and you can do a full text search on the HTML
> source and not
> find "green" anywhere. I'd think it'd either be associated to the td
> or the a for the tab,
> but no dice.
>
> Is the documentation for tab wrong to say that you can assign style or
> styleClass?
>
> Thanks,
> Brian
>
>
> *Venkatesh Babu **_<Venkatesh.M_at_Sun.COM>_* <mailto:Venkatesh.M_at_Sun.COM>
> Sent by: _Venkatesh.M_at_Sun.COM_ <mailto:Venkatesh.M_at_Sun.COM>
>
> 12/19/2007 10:50 PM
> Please respond to_
> __users_at_woodstock.dev.java.net_ <mailto:users_at_woodstock.dev.java.net>
>
>
> To
> _users_at_woodstock.dev.java.net_ <mailto:users_at_woodstock.dev.java.net>
> cc
>
> Subject
> Re: Tab Component not using style or styleClass (resend)
>
>
>
>
>
>
>
>
>
>
>
> 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_ <mailto: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
>
>






unselected-tab.jpg
(image/jpeg attachment: unselected-tab.jpg)

selected.jpg
(image/jpeg attachment: selected.jpg)