Last updated January 14, 2009 16:45, by Jason Lee
==<sc:tabView> - A YUI TabView Wrapper==
This component, and the related <code><sc:tab></code> component, allow you to create a tabbed interface:
<textarea name="code" class="xml"><nowiki>
<sc:tabView maxHeight="auto">
<sc:tab label="Label 1" active="true">
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi
gravida. Etiam nibh metus, tincidunt eget, egestas eu, dictum at,
purus. Integer vehicula eros sit amet magna. Nulla dignissim.
Donec lobortis libero ac lacus. Nulla fermentum enim ac turpis
suscipit aliquet. Maecenas posuere erat nec justo. Cum sociis
natoque penatibus et magnis dis parturient montes, nascetur
ridiculus mus. In suscipit. Nullam ornare velit non felis.
Suspendisse potenti. Mauris orci dui, facilisis fringilla,
facilisis eget, molestie ut, enim. Nullam quam. Quisque aliquet.
Mauris arcu dui, vestibulum eget, commodo et, suscipit in, nunc.
Ut blandit felis ullamcorper magna. Sed nunc neque, tincidunt
ultricies, vehicula ut, aliquam quis, ipsum. Vivamus lorem urna,
volutpat quis, interdum nec, faucibus in, est. Etiam lobortis mi
ac libero.
</sc:tab>
<sc:tab>
<f:facet name="label">
<h:outputText value="Label 2" />
</f:facet>
Some text!
</sc:tab>
<sc:tab>
<f:facet name="label">
<h:outputText value="Label 3" />
</f:facet>
<sc:download mimeType="image/png" fileName="sample.png"
data="#{testBean.image}" urlVar="foo">
<h:graphicImage url="#{foo}" width="250px" />
</sc:download>
</sc:tab>
</sc:tabView>
</nowiki></textarea>
This will render as
[[image:tabView.png]]
Note the the <code><sc:tab></code> component has a <code>label</code> for simple labels on the tab. If however, you would like a more complex label for your tab, the component supports a <code>label</code> facet. The <code><sc:tab></code> component also supports the nesting of any arbitrary JSF component.





