JBoss.orgCommunity Documentation
A link type control for switching between togglePanel facets. Target Panel is specified with "for" attribute. It can be located inside or outside the togglePanel. As the result of switching between facets previous facet is hidden and another one (specified with "switchToState" or panel "stateOrder" attributes) is shown.
Highly customizable look and feel
Can be located anywhere in a page layout
Switching is provided in the three modes
Server
Client
Ajax
As it was mentioned above, the control could be in any place in layout and linked to a switching panel that is managed with "for" attribute (in the "for" attribute the full component "id" is specified according to naming containers).
The togglePanel could be also switched from the side of the control instead of being strictly defined in "switchOrder" attribute of <rich:togglePanel>.
Example:
...
<rich:togglePanel id="panel" initialState="empty" switchType="client">
<f:facet name="first">
<h:panelGroup>
<rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
<rich:toggleControl for="helloForm:panel" value=" Second" switchToState="second"/>
<!--Some content-->
</h:panelGroup>
</f:facet>
<f:facet name="second">
<h:panelGroup>
<rich:toggleControl for="helloForm:panel" value="Empty" switchToState="empty"/>
<rich:toggleControl for="helloForm:panel" value=" first" switchToState="first"/>
<!--Some content-->
</h:panelGroup>
</f:facet>
<f:facet name="empty">
<h:panelGroup>
<rich:toggleControl for="helloForm:panel" value="first" switchToState="first"/>
<rich:toggleControl for="helloForm:panel" value=" second" switchToState="second"/>
</h:panelGroup>
</f:facet>
</rich:togglePanel>
...
In this example the switching is performed on facets specified in the "switchToState" attribute.
Information about the "process" attribute usage you can find " Decide what to process " guide section.
Table of <rich:toggleControl> attributes.
Table 6.152. Component Identification Parameters
Name | Value |
---|---|
component-type | org.richfaces.ToggleControl |
component-class | org.richfaces.component.html.HtmlToggleControl |
component-family | org.richfaces.ToggleControl |
renderer-type | org.richfaces.ToggleControlRenderer |
tag-class | org.richfaces.taglib.ToggleControlTag |
Table 6.153. Classes names that define a component appearance
Class name | Description |
---|---|
rich-tglctrl | Defines styles for a toggle control |