Use the switcher component to dynamically decide which child element to render among a set of possible rendered children. The child elements that can be used inside of switcher are case and default.
The case child element is used to define one of the possible rendered children for the switcher. At least one case element must be specified for a switcher, but any number of case elements can be used inside a switcher.
The childName attribute of switcher specifies the name of the case element whose child element's content will be rendered if the childName attribute of switcher matches the name attribute of case at rendering time.
Use the defaultCase attribute of switcher to specify the name of the case child element that should be rendered if the childName attribute does not match any other case element names.
The default child element of switcher also defines the node to render if none of the other case elements match the childName attribute.
If both the defaultCase attribute and default child element are specified, the default element takes precedence over the defaultCase attribute.
Indexed children of the switcher component are not rendered at all.
Example:
...
<switcher childName="${userData.person}"
defaultCase="defCase">
<case name="defCase">
You have not picked anyone
</case>
<case name="Roger">
You have picked Roger
</case>
<case name="Peter">
You have picked Peter
</case>
</switcher>
...
Inserting a Switcher
Working with Simple and Miscellaneous Components
Copyright © 1997, 2004, Oracle. All rights reserved.