JBoss.orgCommunity Documentation
This chapter details those components which act as panels and containers to hold groups of other components.
			The <rich:panel> component is a bordered panel with an optional header.
		
				No attributes need to be listed for basic usage. a <rich:panel> without any attributes defined renders a bordered region with no header.
			
				To add a header to the panel, use the header attribute to specify the text to appear in the header. Alternatively the header can be constructed using a header facet. Example 9.1, “Adding a header” demonstrates the two different approaches.
			
Example 9.1. Adding a header
<rich:panel header="This is the panel header">
<h:outputText value="This is the panel content" />
</rich:panel>
<rich:panel>
<f:facet name="header">
<h:outputText value="This is the panel header">
</f:facet>
<h:outputText value="This is the panel content" />
</rich:panel>
Both the examples render an identical panel.
						component-type: org.richfaces.Panel
					
						component-class: org.richfaces.component.UIPanel
					
						component-family: org.richfaces.Panel
					
						renderer-type: org.richfaces.PanelRenderer
					
Table 9.1. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties | 
|---|---|---|
| 
 | 
 | background-color | 
| 
 | color | |
| 
 | 
 | background-color, border-color | 
| 
 | color | |
| 
 | font-size | |
| 
 | font-weight | |
| 
 | font-family | |
| 
 | 
 | color | 
| 
 | font-size | |
| 
 | font-family | 
			The <rich:accordion> is a series of panels stacked on top of each other, each collapsed such that only the header of the panel is showing. When the header of a panel is clicked, it is expanded to show the content of the panel. Clicking on a different header will collapse the previous panel and epand the selected one. Each panel contained in a <rich:accordion> component is a <rich:accordionItem> component.
		
				The <rich:accordion> component requires no attributes for basic usage. The component can contain any number of <rich:accordionItem> components as children. The headers of the <rich:accordionItem> components control the expanding and collapsing when clicked. Only a single <rich:accordionItem> can be displayed at a time. Refer to Section 9.2.8, “<rich:accordionItem>” for details on the <rich:accordionItem> component.
			
					All <rich:tabPanel> components should be wrapped in a form element when using either ajax or server mode, as usual for submitting components.
				
				The activeItem attribute holds the active panel name. This name is a reference to the name identifier of the active child <rich:accordionItem> component.
			
				The switching mode for performing submissions is determined by the switchType attribute, which can have one of the following three values:
			
server
							The default setting. Activation of a <rich:accordionItem> component causes the parent <rich:accordion> component to perform a common submission, completely refreshing the page. Only one panel at a time is rendered to the client side.
						
ajax
							Activation of a <rich:accordionItem> component causes the parent <rich:accordion> component to perform an Ajax form submission, and the content of the panel is rendered. Only one panel at a time is rendered to the client side.
						
client
							Activation of a <rich:accordionItem> component causes the parent <rich:accordion> component to perform updates on the client side. All the panels are rendered on the client side during the initial page render. JavaScript changes the styles such that one panel component becomes hidden while the other is shown.
						
				In addition to the standard Ajax events and HTML events, the <rich:accordion> component uses the client-side events common to all switchable panels:
			
						The itemchange event points to the function to perform when the switchable item is changed.
					
						The beforeitemchange event points to the function to perform when before the switchable item is changed.
					
				The <rich:accordion> component uses the server-side events common to all switchable panels:
			
						The ItemChangeEvent event occurs on the server side when an item is changed through Ajax using the server mode. It can be processed using the ItemChangeListener attribute. Refer to Section 9.6.6, “<rich:itemChangeListener>” for details on the <rich:itemChangeListener> tag.
					
		      The <rich:accordion> component can be controlled through the JavaScript API. The JavaScript API provides the following functions, which are common to all switchable panels:
		   
getItems()Return an array of the items contained in the accordion control.
getItemsNames()Return an array of the names of the items contained in the accordion control.
switchToItem(itemName)
		               Switch to and display the item identified by the itemName string passed as a parameter.
		            
firstItem(), prevItem(), nextItem(), lastItem()Get the name of the first item, the previous item, the next item, or the last item.
						component-type: org.richfaces.Accordion
					
						component-class: org.richfaces.component.UIAccordion
					
						component-family: org.richfaces.Accordion
					
						renderer-type: org.richfaces.AccordionRenderer
					
						handler-class: org.richfaces.view.facelets.html.TogglePanelTagHandler
					
Table 9.2. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties | 
|---|---|---|
| 
 | 
 | border-color | 
| 
 | background | |
| 
 | 
 | border-bottom-color | 
| 
 | background-color | |
| 
 | color | |
| 
 | font-weight | |
| 
 | font-family | |
| 
 | font-size | |
| 
 | No skin parameters. | |
| 
 | 
 | color | 
| 
 | No skin parameters. | |
| 
 | 
 | border-bottom-color | 
| 
 | color | |
| 
 | font-family | |
| 
 | font-size | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
				The <rich:accordionItem> component is a panel for use with the <rich:accordion> component. <rich:accordionItem> components can be added dynamically using iteration models with the <c:forEach> tag.
			
					Basic usage of the <rich:accordionItem> component requires the header attribute, which provides the text on the panel header. The panel header is all that is visible when the accordion item is collapsed.
				
					Alternatively the header facet could be used in place of the header attribute. This would allow for additional styles and custom content to be applied to the tab.
				
					In addition to the standard HTML events, the <rich:accordionItem> component uses the client-side events common to all switchable panel items:
				
							The enter event points to the function to perform when the mouse enters the panel.
						
							The leave event points to the function to perform when the mouse leaves the panel.
						
			The <rich:collapsiblePanel> component is a collapsible panel that shows or hides content when the header bar is activated. It is a simplified version of <rich:togglePanel> component.
		
				Basic usage requires the header content is specified either by the header attribute, or by the headerExpanded/headerCollapsed facets. Additionally the panel requires content to display when it is expanded. Content is added as child elements like a standard panel.
			
				The switching mode for performing submissions is determined by the switchType attribute, which can have one of the following three values:
			
server
							This is the default setting. The <rich:collapsiblePanel> component performs a common submission, completely refreshing the page. Only one panel at a time is rendered to the client side.
						
ajax
							The <rich:collapsiblePanel> component performs an Ajax form submission, and only the content of the panel is refreshed. Only one panel at a time is rendered to the client side.
						
client
							The <rich:collapsiblePanel> component changes the state on the client side without any additional requests being sent.
						
				The appearance of the <rich:collapsiblePanel> component can be customized using facets. The headerExpanded and headerCollapsed CSS fclasses are used to style the appearance of the panel when it is expanded and collapsed respectively.
			
				The <rich:collapsiblePanel> component uses the following unique server-side events:
			
						The PanelToggleEvent event occurs on the server side when the <rich:collapsiblePanel> component is expanded or collapsed in either the ajax or server modes. It can be processed using the panelTogglerListener attribute.
					
		      The <rich:collapsiblePanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions:
		   
switchPanel()Switch the state of the collapsible panel (expanded or collapsed).
						component-type: org.richfaces.CollapsiblePanel
					
						component-class: org.richfaces.component.UICollapsiblePanel
					
						component-family: org.richfaces.CollapsiblePanel
					
						renderer-type: org.richfaces.CollapsiblePanelRenderer
					
						handler-class: org.richfaces.view.facelets.html.CollapsiblePanelTagHandler
					
Table 9.3. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties | 
|---|---|---|
| 
 | 
 | color | 
| 
 | background | |
| 
 | 
 | background-color, border-color | 
| 
 | color | |
| 
 | font-weight | |
| 
 | font-family | |
| 
 | font-size | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | 
 | color | 
| 
 | font-family | |
| 
 | font-size | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
				Use the <rich:panelToggleListener> tag to register a PanelToggleListener class on a parent <rich:collapsiblePanel> component. The class provided as a listener must implement the org.richfaces.event.PanelToggleListener interface. The processPanelToggle method accepts an org.richface.event.PanelToggleEvent event as a parameter.
			
			The <rich:popupPanel> component provides a pop-up panel or window that appears in front of the rest of the application. The <rich:popupPanel> component functions either as a modal window which blocks interaction with the rest of the application while active, or as a non-modal window. It can be positioned on the screen, dragged to a new position by the user, and re-sized.
		
				The <rich:popupPanel> does not require any compulsory attributes, though certain use cases require different attributes.
			
				If show="true" then the pop-up panel will display when the page is first loaded.
			
				The <rich:popupPanel> component can be shown and hidden manually using the show() and hide() methods from the JavaScript API. These can be implemented using two different approaches:
			
						Using the <rich:componentControl> component. For details on the component, refer to Section 17.1, “<rich:componentControl>”.
					
						Using the rich:component function. For details on the function, refer to Section 16.2, “rich:component”.
					
				For explicit referencing when using the functions, the component can be given an id identifier.
			
				Example 9.2, “<rich:popupPanel> example” demonstrates basic use of both the <rich:componentControl> component and the rich:component function to show and hide the <rich:popupPanel> component.
			
Example 9.2. <rich:popupPanel> example
<h:commandButton value="Show the panel">
<rich:componentControl target="popup" operation="show" />
</h:commandButton>
...
<rich:popupPanel id="popup">
<p><a href="#" onclick="#{rich:component('popup')}.hide()">Hide the panel</a></p>
</rich:popupPanel>
					The <rich:popupPanel> component is usually rendered in front of any other objects on the page. This is achieved by attaching the component to the <body> element of the page, and setting a very high "z-index" (the stack order of the object). This approach is taken because relatively-positioned elements could still overlap the pop-up panel if they exist at higher levels of the DOM hierarchy, even if their z-index is less than the <rich:popupPanel> component.
				
                    If the <rich:popupPanel> is to participate in submitting child components/behaviors, then a form element must be nested within the <rich:popupPanel>.  Alternatively, if no overlapping elements exist, the <rich:popupPanel> component can be reattached to its original DOM element by setting domElementAttachment to either parent or form.
				
				By default, the <rich:popupPanel> appears as a modal window that blocks interaction with the other objects on the page. To implement a non-modal window instead, set modal="false"
				The pop-up panel can be both re-sized and re-positioned by the user. The minimum possible size for the panel can be set with the minWith and minHeight attributes. These abilities can be deactivated by setting resizable or movable to false as necessary.
				
			
				The pop-up panel can be automatically sized when it is shown if the autosized attribute is set to true.
			
					Embedded objects inserted into the HTML with the <embed> tag could be rendered in front of a <rich:popupPanel> component in some browsers. The <rich:popupPanel> component can be forcibly rendered in front of these objects by setting overlapEmbedObjects="true".
				
					However, due to the additional script processing required when using the overlapEmbedObjects attribute, applications can suffer from decreased performance. As such, overlapEmbedObjects should only be set to true when <embed> or <object> tags are being used in the parent view. Do not set it to true for applications that do not require it.
				
				A panel header and associated controls can be added to the <rich:popupPanel> component through the use of facets. The header facet displays a title for the panel, and the controls facet can be customized to allow window controls such as a button for closing the pop-up. Example 9.3, “Header and controls” demonstrates the use of the facets.
			
Example 9.3. Header and controls
<h:commandLink value="Show pop-up">
<rich:componentControl target="popup" operation="show" />
</h:commandLink>
...
<rich:popupPanel id="popup" modal="false" autosized="true" resizeable="false">
<f:facet name="header">
<h:outputText value="The title of the panel" />
</f:facet>
<f:facet name="controls">
<h:graphicImage value="/pages/close.png" style="cursor:pointer" onclick="#{rich:component('popup')}.hide()" />
</f:facet>
<p>
This is the content of the panel.
</p>
</rich:popupPanel>
			    The <rich:popupPanel> component can contain any other rich component just like a normal panel.
			
				Contents of the <rich:popupPanel> component which are positioned relatively may be trimmed if they extend beyond the borders of the pop-up panel. For certain in-line controls this behavior may be preferable, but for other dynamic controls it could be undesirable. If the trimOverlayedElements attribute is set to false then child components will not be trimmed if they extend beyond the borders of the pop-up panel. For example, if using a calendar, select, or other pop-up component, set trimOverlayedElements="false".
			
		      The <rich:popupPanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions:
		   
getTop()Return the top co-ordinate for the position of the pop-up panel.
getLeft()Return the left co-ordinate for the position of the pop-up panel.
moveTo(top,left)
		               Move the pop-up panel to the co-ordinates specified with the top and left parameters.
		            
resize(width,height)
		               Resize the pop-up panel to the size specified with the width and height parameters.
		            
show()Show the pop-up panel.
hide()Hide the pop-up panel.
						component-type: org.richfaces.PopupPanel
					
						component-class: org.richfaces.component.UIPopupPanel
					
						component-family: org.richfaces.PopupPanel
					
						renderer-type: org.richfaces.PopupPanelRenderer
					
Table 9.4. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties | 
|---|---|---|
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
| 
 | 
 | border | 
| 
 | background | |
| 
 | 
 | background | 
| 
 | 
 | color | 
| 
 | font-weight | |
| 
 | font-family | |
| 
 | font-size | |
| 
 | 
 | color | 
| 
 | font-family | |
| 
 | font-size | |
| 
 | 
 | background | 
| 
 | No skin parameters. | |
| 
 | No skin parameters. | |
			The <rich:tabPanel> component provides a set of tabbed panels for displaying one panel of content at a time. The tabs can be highly customized and themed. Each tab within a <rich:tabPanel> container is a <rich:tab> component. Refer to Section 9.5.7, “<rich:tab>” for further details on the <rich:tab> component.
		
				All <rich:tabPanel> components should be wrapped in a form element when using either ajax or server mode, as usual for submitting components.
			
				The activeItem attribute holds the active tab name. This name is a reference to the name identifier of the active child <rich:tab> component.
			
				The switching mode for performing submissions is determined by the switchType attribute, which can have one of the following three values:
			
server
							The default setting. Activation of a <rich:tab> component causes the parent <rich:tabPanel> component to perform a common submission, completely refreshing the page. Only one tab at a time is rendered to the client side.
						
ajax
							Activation of a <rich:tab> component causes the parent <rich:tabPanel> component to perform an Ajax form submission, and the content of the tab panel is refreshed. Only one tab at a time is rendered to the client side.
						
client
							Activation of a <rich:tab> component causes the parent <rich:tabPanel> component to update on the client side. All the tabs are rendered to the client during the initial page render. JavaScript changes the styles such that one tab becomes hidden while the other is shown.
						
				In addition to the standard Ajax events and HTML events, the <rich:tabPanel> component uses the client-side events common to all switchable panels:
			
						The itemchange event points to the function to perform when the switchable item is changed.
					
						The beforeitemchange event points to the function to perform when before the switchable item is changed.
					
				The <rich:tabPanel> component uses the server-side events common to all switchable panels:
			
						The ItemChangeEvent event occurs on the server side when an item is changed through Ajax using the server mode. It can be processed using the ItemChangeListener attribute. Refer to Section 9.6.6, “<rich:itemChangeListener>” for details on the <rich:itemChangeListener> tag.
					
		      The <rich:tabPanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions, which are common to all switchable panels:
		   
getItems()Return an array of the tabs contained in the tab panel.
getItemsNames()Return an array of the names of the tabs contained in the tab panel.
switchToItem(itemName)
		               Switch to and display the item identified by the itemName string passed as a parameter.
		            
firstItem(), prevItem(), nextItem(), lastItem()Get the name of the first item, the previous item, the next item, or the last item.
						component-type: org.richfaces.TabPanel
					
						component-class: org.richfaces.component.UITabPanel
					
						component-family: org.richfaces.TabPanel
					
						renderer-type: org.richfaces.TabPanelRenderer
					
						handler-class: org.richfaces.view.facelets.html.TogglePanelTagHandler
					
Table 9.5. Style classes (selectors) and corresponding skin parameters
| Class (selector) | Skin Parameters | Mapped CSS properties | 
|---|---|---|
| 
 | 
 | border | 
| 
 | background-color | |
| 
 | color | |
| 
 | 
 | background-color | 
| 
 | No skin parameters. | |
| 
 | 
 | color | 
| 
 | 
 | background-color | 
| 
 | border-color | |
| 
 | No skin parameters. | |
| 
 | 
 | border-bottom | 
| 
 | 
 | font-family | 
| 
 | font-size | |
| 
 | No skin parameters. | |
| 
 | 
 | background | 
| 
 | border | |
| 
 | font-family | |
| 
 | font-size | |
| 
 | 
 | background | 
| 
 | border | |
| 
 | font-family | |
| 
 | 
 | background | 
| 
 | border | |
| 
 | 
 | background | 
| 
 | border | |
| 
 | font-family | |
| 
 | font-size | |
				The <rich:tab> component represents an individual tab inside a <rich:tabPanel> component, including the tab's content. Clicking on the tab header will bring its corresponding content to the front of other tabs.
			
					Basic usage of the <rich:tab> component requires only the tab header and tab content. No additional attributes are required.
				
					The header attribute provides the text on the tab header. The content of the tab is then detailed inside the <rich:tab> tags.
				
					Alternatively, the header facet could be used in place of the header attribute. This would allow custom components to be applied to the tab header. The component also supports three facets to customize the appearance depending on the current state of the tab:
				
headerActive facetThis facet is used when the tab is the currently active tab.
headerInactive facetThis facet is used when the tab is not currently active.
headerDisabled facetThis facet is used when the tab is disabled.
					The header facet is used in place of any state-based facet that has not been defined.
				
					The switching mode for performing submissions can be inherited from the switchType attribute of the parent <rich:tabPanel> component, or set individually for each <rich:tab> component. Refer to Section 9.5, “<rich:tabPanel>” for details on the switchType attribute.
				
					An individual tab can be disabled by setting disabled="true"
					In addition to the standard HTML events, the <rich:tab> component uses the client-side events common to all switchable panel items:
				
							The enter event points to the function to perform when the mouse enters the tab.
						
							The leave attribute points to the function to perform when the mouse leaves the tab.
						
							component-type: org.richfaces.Tab
						
							component-class: org.richfaces.component.UITab
						
							component-family: org.richfaces.Tab
						
							renderer-type: org.richfaces.TabRenderer
						
					The <rich:tab> component uses the same styles as those applied to the parent <rich:tabPanel> component. Refer to Section 9.5.6, “Style classes and skin parameters” for details.
				
			The <rich:togglePanel> component is used as a base for the other switchable components, the <rich:accordion> component and the <rich:tabPanel> component. It provides an abstract switchable component without any associated markup. As such, the <rich:togglePanel> component could be customized to provide a switchable component when neither an accordion component or a tab panel component is appropriate.
		
			The <rich:togglePanel> component acts as a wrapper for multiple <rich:togglePanelItem> components. Each child component is displayed after being activated with the <rich:toggleControl> behavior.
		
Refer to Section 9.6.7, “<rich:toggleControl>” and Section 9.6, “<rich:togglePanel>” for details on how to use the components together.
				The initial state of the component can be configured using the activeItem attribute, which points to a child component to display. Alternatively, if no activeItem attribute is defined, the initial state will be blank until the user activates a panel component with a connected <rich:toggleControl> behavior.
			
The child components are shown in the order in which they are defined in the view, as shown in Example 9.4, “Basic usage”.
					All <rich:tabPanel> components should be wrapped in a form element when using either ajax or server mode, as usual for submitting components.
				
Example 9.4. Basic usage
<rich:togglePanel id="layout" activeItem="item1">
<rich:togglePanelItem name="item1">
<!--content-->
</rich:togglePanelItem>
<rich:togglePanelItem name="item2">
<!--content-->
<rich:togglePanelItem>
</rich:togglePanel>
<h:commandButton>
<rich:toggleControl targetPanel="layout"/> <!--cycles through the states-->
</h:commandButton>
                All the switchable components (<rich:togglePanel>, <rich:accordion> component and the <rich:tabPanel>) can leverage the <a4j:repeat> tag to dynamically create child components.
                This can be useful when the definition of the panel items is determined at run-time from a backing bean list.
            
				The switching mode for performing submissions is determined by the switchType attribute, which can have one of the following three values:
			
server
							The default setting. Activation of a child component causes the parent <rich:togglePanel> component to perform a common submission, completely refreshing the page. Only one child at a time is rendered to the client side.
						
ajax
							Activation of a child component causes the parent <rich:togglePanel> component to perform an Ajax form submission, and the content of the panel is refreshed. Only one child at a time is rendered to the client side.
						
client
							Activation of a child component causes the parent <rich:togglePanel> component to update on the client side. All the items are rendered to the client side during the initial page render. JavaScript changes the styles such that one child component becomes hidden while the other is shown.
						
		      The <rich:togglePanel> component can be controlled through the JavaScript API. The JavaScript API provides the following functions, which are common to all switchable panels:
		   
getItems()Return an array of the items contained in the toggle panel.
getItemsNames()Return an array of the names of the items contained in the toggle panel.
switchToItem(itemName)
		               Switch to and display the item identified by the itemName string passed as a parameter.
		            
firstItem(), prevItem(), nextItem(), lastItem()Get the name of the first item, the previous item, the next item, or the last item.
						component-type: org.richfaces.TogglePanel
					
						component-class: org.richfaces.component.UITogglePanel
					
						component-family: org.richfaces.TogglePanel
					
						renderer-type: org.richfaces.TogglePanelRenderer
					
						handler-class: org.richfaces.view.facelets.html.TogglePanelTagHandler
					
				Use the <rich:itemChangeListener> tag to register an ItemChangeListener class on a parent panel component. The class provided as a listener must implement the org.richfaces.event.ItemChangeListener interface. The processItemChange method accepts an org.richface.event.ItemChangeEvent event as a parameter.
			
				The <rich:itemChangeListener> tag can be used with any of the switchable panel components:
			
						<rich:togglePanel> (refer to Section 9.6, “<rich:togglePanel>”)
					
						<rich:accordion> (refer to Section 9.2, “<rich:accordion>”)
					
						<rich:tabPanel> (refer to Section 9.5, “<rich:tabPanel>”)
					
						<rich:panelMenu> (refer to Section 12.4, “<rich:panelMenu>”)
					
				The <rich:toggleControl> behavior can be attached to any interface component, whether inside or outside the controlled panel itself. It works with a <rich:togglePanel> component to switch between different <rich:togglePanelItem> components. Refer to Section 9.6, “<rich:togglePanel>” and Section 9.6.8, “<rich:togglePanelItem>” for details on how to use the components together.
			
				The <rich:toggleControl> implements the JSF BehaviorHolder component, which provides events to attached components and behaviors.
			
					If the <rich:toggleControl> component is positioned inside a <rich:togglePanel> component, no panel attachment attributes need to be defined, as the control is assumed to switch through the <rich:togglePanelItem> components of its parent <rich:togglePanel> component.
				
					A <rich:toggleControl> component can be located outside the <rich:togglePanel> component it needs to switch. Where this is the case, the <rich:togglePanel> is identified using the targetPanel attribute.
				
					The <rich:toggleControl> component can switch the attached <rich:togglePanel> component in multiple ways:
				
							By default, the <rich:toggleControl> component will cycle through <rich:togglePanelItem> components in the order they are defined within the view.
						
Example 9.5. Default switching
<rich:togglePanel id="layout">
<rich:togglePanelItem>
<!--content-->
</rich:togglePanelItem>
<rich:togglePanelItem>
<!--content-->
<rich:togglePanelItem>
</rich:togglePanel>
<h:commandButton>
<rich:toggleControl targetPanel="layout"/> <!--cycles through the states-->
</h:commandButton>
							The next item to switch to can be explicitly defined by including a <rich:toggleControl> component within a <rich:togglePanelItem> component. Point the targetItem to the <rich:togglePanelItem> to switch to when the state is next changed.
						
Example 9.6. Explicit switching
<rich:togglePanel activeItem="item1">
<rich:togglePanelItem id="item1">
<!--content-->
<h:commandButton>
<rich:toggleControl targetItem="item2"> <!--switches to item2 -->
</h:commandButton>
</rich:togglePanelItem>
<rich:togglePanelItem id="item2">
<!--content-->
<h:commandButton>
<rich:toggleControl targetItem="item1"> <!--switches to item1 -->
</h:commandButton>
<rich:togglePanelItem>
</rich:togglePanel>
							Alternatively, use the targetItem attribute with keywords to switch items. The @first, @prev, @next, and @last keywords switch to the first item, the previous item, the next item, and the last item respectively.
						
Example 9.7. Keyword-based switching
<rich:togglePanel activeItem="item1">
<rich:togglePanelItem id="item1">
<!--content-->
<h:commandButton>
<rich:toggleControl targetItem="@next"> <!--switches to next item (item2)-->
</h:commandButton>
</rich:togglePanelItem>
<rich:togglePanelItem id="item2">
<!--content-->
<h:commandButton>
<rich:toggleControl targetItem="@prev"> <!--switches to previous item (item1)-->
</h:commandButton>
<rich:togglePanelItem>
</rich:togglePanel>
							client-behavior-renderer-type: org.richfaces.component.behavior.ToggleControl
						
							behavior-id: org.richfaces.component.behavior.ToggleControl
						
							handler-class: org.richfaces.view.facelets.html.CustomBehaviorHandler
						
							behavior-class: org.richfaces.component.behavior.ToggleControl
						
							client-behavior-renderer-class: org.richfaces.renderkit.html.ToggleControlRenderer
						
				The <rich:togglePanelItem> component is a switchable panel for use with the <rich:togglePanel> component. Use the <rich:togglePanelItem> component to define the content for a panel using nested components. Switching between <rich:togglePanelItem> components is handled by the <rich:toggleControl> behavior.