SetLabelProperty Method for a Control

The SetLabelProperty method sets the properties of a label. This method does not return any information.

Format

controlVar.SetLabelProperty(propName, propValue)

The following table describes the arguments for the SetLabelProperty method.

Argument Description

propName

The name of the property that Siebel CRM must set. The values that you can enter are described later in this topic.

propValue

The value to set for the property. The values that you can enter are described later in this topic.

Usage

If you must set more than one property, then you must use a separate statement for each property.

Enabling the SetLabelProperty Method

Siebel CRM does not enable the SetLabelProperty method by default. You must enable it in Siebel Tools before you use it in a script.

To enable the SetLabelProperty method

  1. Open Siebel Tools.

  2. Display the Control User Prop object type:

    1. Choose the View menu, and then the Options menu item.

    2. Click the Object Explorer tab.

    3. Scroll down through the Object Explorer Hierarchy window until you locate the Applet tree.

    4. Expand the Applet tree, expand the Control tree, and then make sure the Control User Prop object type includes a check mark.

    5. Click OK.

  3. In the Object Explorer, click Applet.

  4. In the Applets list, locate the applet that includes the control you must modify.

  5. In the Object Explorer, expand the Applet tree, and then click Control.

  6. In the Controls list, locate the control you must modify.

  7. In the Object Explorer, expand the Control tree, and then click Control User Prop.

  8. In the Control User Props list, add a new control user property using values from the following table.

    Property Value

    Name

    useLabelID

    Value

    TRUE

Properties to Set for a Label

The following table lists the properties you can set for a label.

Property Value Description

BgColor

string

Determines the background color for a label. For example:

  • Red is #ff0000.

  • Green is #00ff00.

  • Blue is #0000ff.

FontColor

string

Determines the font color for a label. For example, green is #00ff00.

FontType

string

Determines the font type for a label. For example, Times Roman.

FontSize

string

Determines the font size for a label. For example, 12 pt.

FontStyle

string

Determines the font style for a label. For example, italic.

FontWeight

string

Determines the font weight for a label. You can use the following values:

  • bold

  • bolder

  • lighter

  • normal

  • 100, 200, 300, or 400. These values are equivalent to light.

  • 500, 600, or 700. These values are equivalent to normal.

  • 800 or 900. These values are equivalent to bold.

The default value is normal.

Height

string

Determines height for a label, in pixels. For example, 5.

Visible

visible or hidden

Determines if the label is visible. The default value is the value in the Siebel runtime repository.

Width

string

Determines the width for a label, in pixels. For example, 80.

Used With

Browser Script

Examples

The following code uses the SetLabelProperty method:

function Applet_PreInvokeMethod (name, inputPropSet){

switch (name) {

  // Example of changing the font size of the Location label
  case ("fontsize"):
  {

    var ctl = this.FindControl("Location");
    var fSize = prompt("Specify the required label font size (numeric value 
    only).");
    ctl.SetLabelProperty("FontSize", fSize);
    return ("CancelOperation");

  }

  // Example of changing the background color of the Location label
  case ("bgcolor"):
  {

    var ctl = this.FindControl("Location");
    var bgColor = prompt("Specify th ebackground color of the label. Enter a valid 
    six hexadecimal digit RGB value preceded by #");
    ctl.SetLabelProperty("BgColor", bgColor);
    return ("CancelOperation");

  }

  // Example of changing the font type of the Location label
  case ("fonttype"):
  {

    var ctl = this.FindControl("Location");
    var fontType =prompt("Specify the font type for the label.");
    ctl.SetLabelProperty("FontType", fontType);
    return ("CancelOperation");

  }
  // Example of changing the font color of the Location label
  case ("fontcolor"):
  {

    var ctl = this.FindControl("Location");
    var fontColor = prompt("Specify the font color of the label. Enter a valid six 
    hexadecimal digit RGB value preceded by #");
    ctl.SetLabelProperty("FontColor", fontColor);
    return ("CancelOperation");

  }

  break;

  }

}