Configuring Siebel Open UI > Application Programming Interface > Methods of the Siebel Open UI Application Programming Interface >

Template Manager Class


This topic describes the Template Manager Class. This topic contains the following topics:

About the Template Manager Class

The Template Manager class generates HTML for various controls, and uses the following method and syntax:

GenerateMarkup( configObject );

The GenerateMarkup method uses only one argument, that is an object. Depending on the properties present in object, Template Manager chooses the appropriate flow for the generation of the HTML. The following list describes the different properties that you can specify via configObject:

  • type. Specify the type of control to generate. For a list of types, please see Table 39. When not specified, the value will default to the input field or SWE_CTRL_TEXT.
  • class. Specify the class name to attach to the control. If multiple classes need to be attached, use a space-separated string. TM will also attaches pre-defined CSS class name for the control, based on the type of control being generated.
  • id. Specify the ID which needs to be given to the control. Depending on the control type provided, auto generated value for ID can be attached by TM to the control if not provided.
  • values. Specify the value that needs to be attached to the control.

    NOTE:  When specifying ComboBox for the type, you can specify an array of values. Also, the selected index needs to be specified with the property index.

  • attrs. Specify any other attribute that should be attached to the control, in string format. For example, if you need aria attributes aria-label, aria-labelledby, and aria-describedby to be attached to the control, you would use the following code:

    "aria-label='abc' aria-labelledby='xyz' aria-describedby='123'"

About Supported Template Manager Controls

This topic describes supported Template Manager controls.

The Template Manager class provides mark-up for the many types of controls required in Siebel Open UI. Table 39 lists the supported Template Manager controls.

Table 39.  Supported Template Manager Controls
HTML Type in Siebel Open UI
Corresponding SWE Constants
Additional Information

Button

SWE_PST_BUTTON_CTRL

None.

Text Field

SWE_CTRL_TEXT

None.

span

SWE_CTRL_PLAINTEXT

None.

Check Box

SWE_CTRL_CHECKBOX

None.

Date (HTML5)

SWE_CTRL_DATE_PICK

Falls back to HTML4 input field control.

Date Time (HTML5)

SWE_CTRL_DATE_TIME_PICK

Falls back to HTML4 input field control.

URL (HTML5)

SWE_CTRL_URL

None.

TEL (HTML5)

SWE_CTRL_PHONE

Falls back to HTML4 input field control.

File

SWE_CTRL_FILE

None.

Radio

SWE_CTRL_RADIO

None.

Eff Date

SWE_CTRL_EFFDAT

None.

MVG

SWE_CTRL_MVG

None.

Pick

SWE_CTRL_PICK

None.

Detail

SWE_CTRL_DETAIL

None.

Calc

SWE_CTRL_CALC

None.

Link

SWE_CTRL_LINK

Links with the address in src property.

MailTo

SWE_CTRL_MAILTO

Links with the address supplied in src property.

Img

SWE_CTRL_IMAGECONTROL

Image with the source provided in src property.

Text Area

SWE_CTRL_TEXTAREA

None.

Label

SWE_CTRL_LABEL

None.

ComboBox (Select)

SWE_CTRL_COMBOBOX

Accepts the following additional configuration:

  • displayValue. An array of values that should be displayed in the Option List.
  • value. An array of actual values.
  • index. Zero-based value that indicates currently selected value.
Examples Using Template Manager

This topic describes examples of using Template Manager. The examples in this section assume that tmplMgr is a reference to the Template Manager Object, and consts is a reference to SiebelApp.Constants object.

Example of Generating Markup for a Normal Text Field

In this example, we use the following code make the call to the Template Manager to generate markup for a normal text field:

var markup = tmplMgr.GenerateMarkup({

type : consts.get( "SWE_CTRL_TEXT" )

});

In the this example, this is the expected HTML string begin held by the markup variable:

<input type="text" class="siebui-input " />

Example of Generating Markup with an Additional className

In this example, we use the following code make the call to the Template Manager to generate markup for with an additional className:

var markup = tmplMgr.GenerateMarkup({

type : consts.get( "SWE_CTRL_TEXT" ),

class: "siebui-align-left"

});

In the this example, this is the expected HTML string begin held by the markup variable:

<input type="text" class="siebui-input siebui-align-left" />

Example of Generating Markup with Additional Attributes

In this example, we use the following code make the call to the Template Manager to generate markup for with additional attributes:

var markup = tmplMgr.GenerateMarkup({

type : consts.get( "SWE_CTRL_TEXT" ),

attrs: "aria-label=\"abc\" aria-labelledby=\"xyz\" aria-describedby=\"123"

});

In the this example, this is the expected HTML string begin held by the markup variable:

<input type="text" class="siebui-input " aria-label="abc" aria-labelledby="xyz" aria-describedby="123 />

Example of Generating a Combo Box with Multiple Options

In this example, we use the following code make the call to the Template Manager to generate a combo box with multiple options, Value 1, Value 2, and Value 3:

var markup = tmplMgr.GenerateMarkup({

type : consts.get( "SWE_CTRL_COMBOBOX" ),

value: [ "Value 1", "Value 2", "Value 3" ],

index: 1 // zero based index

});

In the this example, this is the expected HTML string begin held by the markup variable:

<select class="siebui-select ">

<option>Value 1</option>

<option selected> Value 2</option>

<option>Value 3</option>

</select>

Example of Generating a Hyperlink

In this example, we use the following code make the call to the Template Manager to generate a hyperlink:

var markup = tmplMgr.GenerateMarkup({

type : consts.get( "SWE_CTRL_LINK" ),

src : "http://www.oracle.com",

value: "Oracle HomePage"

});

In the this example, this is the expected HTML string begin held by the markup variable:

<a class="siebui-link" src="http://www.oracle.com>Oracle HomePage</a>

Configuring Siebel Open UI Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.