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
-
Open Siebel Tools.
-
Display the Control User Prop object type:
-
Choose the View menu, and then the Options menu item.
-
Click the Object Explorer tab.
-
Scroll down through the Object Explorer Hierarchy window until you locate the Applet tree.
-
Expand the Applet tree, expand the Control tree, and then make sure the Control User Prop object type includes a check mark.
-
Click OK.
-
-
In the Object Explorer, click Applet.
-
In the Applets list, locate the applet that includes the control you must modify.
-
In the Object Explorer, expand the Applet tree, and then click Control.
-
In the Controls list, locate the control you must modify.
-
In the Object Explorer, expand the Control tree, and then click Control User Prop.
-
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:
|
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:
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;
}
}