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.

The following image shows the object relationships that Siebel CRM uses with the variable conditional tag.

Object Relationships Siebel CRM Uses with the Variable Conditional Tag: This image is described in the surrounding text.

Example Code That Uses the Variable Conditional Tag

As show in this image:

  • 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.