Switch, Case, and Default Conditional Tags

If used together, then the following tags provide a conditional branching capability that is similar to the switch, case, and default statements in JavaScript:

  • <div od-switch>

  • <div od-case="<>">

  • <div od-default>

The <div od-switch> tag is a container tag for the <div od-case="<>"> and <div od-default> tags.

Format for the Switch, Case, and Default Conditional Tags

The <div od-switch>, <div od-case="<>">, and <div od-default> tags use the following format:

<div od-switch>
<div od-case="xxx">
...
<!--od section xxx close-->
</div>
<div od-case="yyy">
...
<!--od section yyy close-->
</div>
<div od-default>
...
<!--od section default close-->
</div>
<!--od section switch close-->
</div>

Attributes for the Switch, Case, and Default Conditional Tags

The <div od-case="<>"> tag includes the Condition attribute. The <div od-switch> and <div od-default> tags include no attributes. To process these tags, Siebel CRM does the following:

  • Ignores any tags that exist in the body of the <div od-switch> tag that are not the <div od-case="<>"> tag or <div od-default> tag.

  • Examines the <div od-case="<>"> tags, starting with the first <div od-case="<>"> tag, and then does one of the following:

    • If any of the <div od-case="<>"> tags satisfy the condition, then Siebel CRM skips any other <div od-case="<>"> tags and <div od-default> tags, and then processes the body of the <div od-case="<>"> tag that satisfies the condition.

    • If none of the <div od-case="<>"> tags satisfy their conditions, then Siebel CRM processes the body of the <div od-default> tag. You must make sure that the body of a <div od-switch> tag contains only a <div od-default> tag.