Configuring Siebel Business Applications > About Siebel Web Templates and Siebel Tags > About Siebel Tags >

About Siebel Conditional Tags


This topic describes Siebel Web Engine conditional tags. For more information, see Siebel Developer's Reference.

If Conditional Tag

The <div od-if="<>"> tag provides a simple conditional branching capability. It uses the following format:

<div od-if="<>"> ... <!--od <tagName> close-> </div>

The <div od-if="<>"> tag includes the Condition attribute. Siebel CRM does the following:

  • If the condition is TRUE, then Siebel CRM processes the body of the <div od-if="<>"> tag.
  • If the condition is FALSE, then Siebel CRM skips the body of the <div od-if="<>"> tag.

The <div od-if="<>"> tag does not provide an else capability. To implement an else condition, you can use some combination of the <div od-switch>, <div od-case="<>">, and <div od-default> tags.

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.

Variable Conditional Tag

An applet template includes the <div od-if="Context, <object>"> tag. It conditionally express the body of the <div od-if="Context, <object>"> tag as determined by a variable that is set in a parent view web template. For the purposes of the <div od-if="Context, <object>"> tag, if an applet is associated with a view, then the web template in the applet acts as a child of the view web template.

The applet placeholder in the view web template must define a variable that the <div od-if="Context, <object>"> tag in the child applet template can evaluate.

The expression in the <div od-if="Context, <object>"> tag returns a value of true or false depending on if the variable it evaluates is a property of the <div od-type="applet"> tag in the corresponding view web template. You can use this configuration to conditionally display parts of an applet depending on the position of the part in a view.

Figure 39 describes object relationships that Siebel CRM uses with the variable conditional tag.

Figure 39.  Object Relationships Siebel CRM Uses with the Variable Conditional Tag
Example Code That Uses the Variable Conditional Tag

In this example, a view uses a template that contains the following tags:

<div od-type="applet" hintMapType="Applet" id="1" property="FormattedHtml" hintText="Applet" var="Parent"/>

<div od-type="applet" hintMapType="Applet" id="2" property="FormattedHtml" hintText="Applet" var="Child"/>

The view object references an applet through a view web template item. The template for this applet includes the following tags:

<div od-if="Context, Parent">

<td valign="middle" nowrap>

<div od-type="menu" type="Button" bitmap="MenuBttn" width="38" height="15" bgcolor="gray" fgcolor="blue"/>

</td>

<!--od section Parent close->

</div>

<div od-if="Context, Child">

<td valign="middle" nowrap>

<div od-type="menu" type="Button" bitmap="MenuBttn" width="38" height="15" bgcolor="gray" fgcolor="red"/>

</td>

<!--od section Child close->

</div>

If you move the applet into the placeholder in the view web template, and if the applet Id for this placeholder is:

  • 1. The first div od-if="Context, Parent"> condition returns TRUE and the second condition returns FALSE. This occurs because the var property of the <div od-type="applet"> placeholder that contains an Id of 1 is set to Parent. As a result, Siebel CRM displays the button menu with a blue foreground.
  • 2. Siebel CRM displays the button menu with a red foreground.
Configuring Siebel Business Applications Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.