<t:panelTabbedPane>
The panelTabbedPane is quite simple to use. But sometimes errors occur, where it is difficult to determine the reason. Mostly it is related to a misconfiguration of your webapp (web.xml).
To check that everything runs fine, take a look at the produced HTML-code. The component includes a default stylesheet (defaultStyle.css) and much javascript-code.
{{{<html>
<body>
<f:view>
<t:panelTabbedPane bgcolor="#FF0000">
<t:panelTab id="tab01" label="Tab No.1">
<t:outputText value="something"></t:outputText>
</t:panelTab> <t:panelTab id="tab02" label="Tab No.2">
<t:outputText value="something else"></t:outputText>
</t:panelTab>
</t:panelTabbedPane>
</f:view>
</body>
</html>}}}
Notes about Attributes
Below is additional documentation about attributes. At some point the TagLib Documentation will be updated to include these notes.
selectedIndex
- The first tab's index is 0
serverSideTabSwitch
When set to false all tab switching is done on the client, thus no round trips to the server. Their may be an issue related to redisplay cause by a validation error. See http://issues.apache.org/jira/browse/TOMAHAWK-543
Default value is false
More
See SettingTabClasses for some information on tab styles.
FAQ
The Panel-Tabs are rendered as buttons !?
The component doesn't include the default-stylesheet and some javascript-code. Check your web.xml for filter-configuration :
{{{<filter>
<filter-name>extensionsFilter</filter-name> <filter-class>
org.apache.myfaces.component.html.util.ExtensionsFilter
</filter-class> <init-param>
<description>
- Set the size limit for uploaded files. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description> <param-name>uploadMaxFileSize</param-name> <param-value>100m</param-value>
</init-param> <init-param>
<description>
- Set the threshold size - files below this limit are stored in memory, files above this limit are stored on disk. Format: 10 - 10 bytes 10k - 10 KB 10m - 10 MB 1g - 1 GB
</description> <param-name>uploadThresholdSize</param-name> <param-value>100k</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>extensionsFilter</filter-name> <url-pattern>*.jsf</url-pattern>
</filter-mapping> <filter-mapping>
<filter-name>extensionsFilter</filter-name> <url-pattern>*.faces</url-pattern>
</filter-mapping> <filter-mapping>
<filter-name>extensionsFilter</filter-name> <url-pattern>/faces/*</url-pattern>
</filter-mapping>
}}}
Every jsf-Page has to go through the filter.
I added the filter and mappings to my web.xml and still have buttons for Panel-Tabs!?
If you are using a connector between Apache and Tomcat, make sure you add the following to your httpd.conf:
JKMount /*.jsf ajp13 JKMount /*.faces ajp13 JKMount /''your context root''/faces/* ajp13
The defaultStyle.css is served through your servlet container, not your web server. Without this, you will get a lot of 404 errors in your Apache error logs.