Siebel Object Interfaces Reference > Interfaces Reference > Applet Events >

WebApplet_ShowControl


This event allows scripts to modify the HTML generated by the Siebel Web Engine to render a control on a Web page in an application running in Standard Interactivity mode.

Syntax

WebApplet_ShowControl (controlName, property, mode, HTML)

Parameter
Description
controlName
A string indicating the name of the control to be rendered.
property
A string indicating the value of the property attribute of the swe:control or swe:this tag that triggers this event; it can also be an empty string if this attribute is not specified for the tag.
mode
The mode of the applet that is being shown; possible modes are:
  • Base
  • Edit
  • New
  • Query
  • Sort
HTML
The HTML generated by the Siebel Web Engine for the swe:control or swe:this tag that triggers this event.

Returns

Not applicable

Usage

The generated HTML depends on the control, the property being shown, and the mode of the applet. The script can modify the value of the HTML parameter, and the Siebel Web Engine sends the modified value back to the Web browser.

Customer applications render the layout of applets using template files (.swt files). These are HTML files that contain special placeholder tags that indicate where a control is to be rendered. These control placeholder tags (<swe:control>) can be included in the following two ways:

In the first instance, if the control ID is mapped to an actual control in the applet using Siebel Tools, Siebel Web Engine renders the DisplayName property of the control at the point where this tag is placed in the template file.

In the second instance, the Siebel Web Engine renders the DisplayName property of the control at the point where the <swe:this> tag is placed in the template file. The outer <swe:control> tag in this case is used only to check if the control ID is mapped to an actual control in the applet.

The Siebel Web Engine converts these tags into HTML to render the controls on the Web page. The WebApplet_ShowControl event is triggered for each of these tags after the Siebel Web Engine has generated the HTML for rendering the control, but before the generated HTML is sent back to the browser. This gives the scripts a chance to modify the generated HTML before it is shown.

In the first example, the event fires only once, after the Siebel Web Engine generates the HTML for the <swe:control> tag. In the second example, this event gets fired twice. The event is first fired when the Siebel Web Engine has generated the HTML for the <swe:this> tag. The event is fired again when the Siebel Web Engine has generated the HTML for the outer <swe:control> tag; that is, after everything between the <swe:control> and </swe:control> tags, including the <swe:this> tag, is converted into HTML. The script can distinguish between these two event calls by the value of the property attribute of the tag that is passed as a parameter to the event.

The WebApplet_ShowControl event is supported in Standard Activity applications only.

Used With

Server Script

Example

This Siebel eScript script displays negative amounts in red in a read-only form.

function WebApplet_ShowControl (ControlName, Property, Mode, &HTML)

{
   var BC = me.BusComp;
   if( ControlName == "Amount" && Mode == "Base" && Property == "FormattedHTML")
   {
      var amount = ToNumber(BC.GetFieldValue ("Transaction Amount"));
         If amount < 0
            HTML = "<FONT Color=Red> " + HTML + " </FONT>";
   }
}


 Siebel Object Interfaces Reference 
 Published: 18 June 2003