Create new RichFaces Documentation Jira issue

This will launch the RichFaces Jira page - to complete your feedback please login if needed, and submit the Jira.

JBoss.orgCommunity Documentation

6.10.16.  < rich:toggleControl > available since 3.0.0

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.


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.



You can find all necessary information about style classes redefinition in
Definition of Custom Style Classes section.