Siebel Object Interfaces Reference > Siebel Object Interfaces Reference > Object Interfaces Reference >

Applet Methods


This topic describes applet methods. It includes the following topics:

In these methods, the Applet variable represents an applet instance.

ActiveMode Method for an Applet

The ActiveMode method returns a string that contains the name of the current Web template mode.

Format

Applet.ActiveMode

No arguments are available.

Used With

Browser Script

Examples

The following example is in Browser Script:

function Applet_Load ()
{
   var currMode = this.ActiveMode();
   theApplication().SWEAlert("The active mode for the selected applet is: " +
     currMode);
}

BusComp Method for an Applet

The BusComp method when used in the context of an applet returns the current business component instance that this applet references.

Format

Applet.BusComp();

No arguments are available.

Used With

Browser Script, Server Script

BusObject Method for an Applet

The BusObject method returns the name of the business object that the business component references.

Format

Applet.BusObject()

No arguments are available.

Used With

Browser Script, Server Script

Examples

The following example is in Browser Script:

function Applet_Load ()
{
   var appletname = this.Name();
   var currBO = this.BusObject();
   var currBOName = currBO.Name();
   theApplication().SWEAlert("The active Business Object for the " + appletname +
     " is: " + currBOName);
}

The following example is in Siebel eScript:

function WebApplet_Load ()
{
   var busObj = this.BusObject();
}

The following example is in Siebel VB:

Sub WebApplet_Load
   Dim oBusObject As BusObject
   Set oBusObject = Me.BusObject

End Sub

FindActiveXControl Method for an Applet

The FindActiveXControl method returns the name of a control that is a Document Object Model element.

Format

Applet.FindActiveXControl(controlName)

Table 19 describes the arguments for the Browser Script format of the FindActiveXControl method.

Table 19. Arguments for the Browser Script Format of the FindActiveXControl Method
Argument
Description

controlName

Literal string or string variable that contains the name of the control.

Usage

You can use the FindActiveXControl method to find a control on a form applet. It does not locate a list column on a list applet.

Used With

Browser Script

Examples

The following Browser Script example interacts with a Microsoft slide ActiveX control that resides on a Siebel applet:

// Get a reference to the control
var SlideCtrl = FindActiveXControl("SliderControl");

// Display some of the ActiveX Control's properties
theApplication().SWEAlert ("element id = " + SlideCtrl.id);
theApplication().SWEAlert ("Max ticks = " + SlideCtrl.Max);

SlideCtrl.SelStart = 2; // Set a control property
SlideCtrl.Refresh(); // Call the control's Refresh method

var myCustomCtrl = FindActiveXControl("TestControl");
myCustomCtrl.TestProperty01 = "abc";
myCustomCtrl.Style.visibility = "hidden"; // Use a Style sheet property

FindControl Method for an Applet

The FindControl method returns the name of a control. This applet must be part of the view that Siebel CRM displays.

Format

Applet.FindControl(controlName)

The arguments you can use with this format are the same as the arguments described in Table 19.

Usage

The FindControl method does not do the following:

  • Locate a control in an MVG applet, pick applet, associate applet, or detail applet. In Siebel Tools, these applets do not appear in the child View Web Template Items list of the view.
  • Locate list columns in a list applet.
Used With

Browser Script

Examples of Using the FindControl Method

The following example is in Browser Script:

function Applet_PreInvokeMethod (name, inputPropSet)
   {
   // Code to modify the Font Size of the "Location" label
   if (name == "fontsize")
      {
      // Use FindControl() to get a reference to the control
      var ctl = this.FindControl("Location");

      ctl.SetLabelProperty("FontSize", "22"); // Set the font size
      return ("CancelOperation");
   }
}

To use this example, see SetLabelProperty Method for a Control.

InvokeMethod Method for an Applet

The InvokeMethod method calls a specialized method. It returns the following:

  • In Server Script, returns a string that contains the result of the method.
  • In Browser Script, returns a property set.
Browser Script Format

Applet.InvokeMethod(methodName, methodArgs_PropSet);

Table 20 describes the arguments for the Browser Script format of the InvokeMethod method.

Table 20. Arguments for the Browser Script Format of the InvokeMethod Method
Argument
Description

methodName

The name of the method.

methodArgs_PropSet

Property set that contains the method arguments.

Server Script Format

Applet.InvokeMethod(methodName, methArg1, methArg2, methArgN);

Table 21 describes the arguments for the Browser Script format of the InvokeMethod method.

Table 21. Arguments for the Browser Script Format of the InvokeMethod Method
Argument
Description

methodName

The name of the method.

You can use the following arguments:

  • methArg1
  • methArg2
  • methArgN

One or more strings that contain arguments for the methodName argument.

Usage

Available with Server Script and Browser Script. Note the following:

  • If the method that the methodName argument identifies exists in the browser, then Siebel CRM runs this method in the browser.
  • If the method that the methodName argument identifies exists on the Siebel Server, then Siebel CRM runs this method on the Siebel Server.
Caution About Using the InvokeMethod Method

You must use InvokeMethod only to call a method that this book describes.

Used With

Browser Script, Server Script

Examples

The following example is in Siebel eScript:

function WebApplet_PreInvokeMethod (MethodName)
{
   //Call a Siebel SmartScript from a custom button
   //using the applet.InvokeMethod method
   //Note the InvokeSScriptFromButton is from a custom
   //method added to a button
   if (MethodName == "InvokeSScriptFromButton")
   {
      var iReturn = ContinueOperation;
      var sArgs = new Array(3);
      sArgs[0] = "Demo Opportunity Profile";
      sArgs[1] = "";
      sArgs[2] = "";
      this.InvokeMethod("RunCallScript", sArgs);
      iReturn = CancelOperation;
   }
   else
   {
      iReturn = ContinueOperation;
   }
   return(iReturn);
}

Name Method for an Applet

The Name method for an applet returns the name of an applet.

Format

Applet.Name()

No arguments are available.

Used With

Browser Script, Server Script

Examples

The following example is in Browser Script:

function Applet_Load ()
   {
   //Display the name of the applet if the applet loads using the
   //applet.Name() method that gets the name of the applet
   var appletName;
   appletName = this.Name();
   theApplication().SWEAlert("The name of the applet is: " + appletName);
}

The following example is in Siebel eScript:

function WebApplet_Load ()
{
   //Display the name of the applet if the applet loads using the
   //applet.Name() method that gets the name of the applet
   var appletName;
   appletName = this.Name();
   TheApplication().RaiseErrorText("The name of the applet is: " + appletName);
}

The following example is in Siebel VB:

Sub WebApplet_Load
' Display the name of the applet if the applet loads using the
' applet.Name() method that gets the name of the applet
Dim appletName As String
appletName = Me.Name
TheApplication.RaiseErrorText "The name of the applet is: " & appletName
End Sub

Siebel Object Interfaces Reference Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.