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 swe:if tag provides a simple conditional branching capability. It uses the following format:

<swe:if condition="xxx"> ... </swe:if>

The swe:if tag includes the Condition attribute. Siebel CRM does the following:

  • If the condition is TRUE, then Siebel CRM processes the body of the swe:if tag.
  • If the condition is FALSE, then Siebel CRM skips the body of the swe:if tag.

The swe:if tag does not provide an else capability. To implement an else condition, use some combination of the swe:switch, swe:case, and swe: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:

  • swe:switch
  • swe:case
  • swe:default

The swe:switch tag is a container tag for the swe:case and swe:default tags.

Format for the Switch, Case, and Default Conditional Tags

The swe:switch, swe:case, and swe:default tags use the following format:

<swe:switch>

<swe:case condition="xxx">

...

</swe:case>

<swe:case condition="yyy">

...

</swe:case>

<swe:default>

...

</swe:default>

</swe:switch>

Attributes for the Switch, Case, and Default Conditional Tags

The swe:case tag includes the Condition attribute. The swe:switch and swe:default tags include no attributes. To process these tags, Siebel CRM does the following:

  • Ignores any tags in the body of the swe:switch tag that are not the swe:case tag or swe:default tag.
  • Examines the swe:case tags, starting with the first swe:case tag, and then does one of the following:
    • If any of the swe:case tags satisfies the condition, then Siebel CRM skips any other swe:case tags and swe:default tags and processes the body of the swe:case tag that satisfied the condition.
    • If none of the swe:case tags satisfy their conditions, then Siebel CRM processes the body of the swe:default tag. You must make sure that the body of a swe:switch tag contains only a swe:default tag.

Variable Conditional Tag

An applet template includes the swe:if-var tag. It conditionally express the body of the swe:if-var tag as determined by a variable that is set in a parent view web template. For the purposes of the swe:if-var 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 swe:if-var tag in the child applet template can evaluate.

The expression in the swe:if-var tag returns a value of true or false depending on if the variable it evaluates is or is not a property of the swe:applet tag in the corresponding view web template. You can use this technique to conditionally display parts of an applet depending on the position of the part in a view.

Figure 34 illustrates object relationships that Siebel CRM uses with the variable conditional tag.

Figure 34.  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:

<swe:applet hintMapType="Applet" id="1" property="FormattedHtml" hintText="Applet" var="Parent"/>

<swe: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:

<swe:if-var name="Parent">

<td valign="middle" nowrap>

<swe:menu type="Button" bitmap="MenuBttn" width="38" height="15" bgcolor="gray" fgcolor="blue"/>

</td>

</swe:if-var>

<swe:if-var name="Child">

<td valign="middle" nowrap>

<swe:menu type="Button" bitmap="MenuBttn" width="38" height="15" bgcolor="gray" fgcolor="red"/>

</td>

</swe:if-var>

If you drag and drop the applet into the placeholder in the view web template:

  • And the applet Id for this placeholder is 1, then the first swe:if-var condition returns TRUE and the second condition returns FALSE. This is because the var property of the swe: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.
  • And the applet Id for this placeholder is 2, then Siebel CRM displays the button menu with a red foreground.
Configuring Siebel Business Applications Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Legal Notices.