Siebel Object Interfaces Reference > Interfaces Reference > Control Methods >

SetValue Method


The SetValue method sets the contents of the specified control to the value indicated.

Syntax

controlVar.SetValue (controlValue)

Argument
Description

controlValue

String containing the value to which to set the control

Returns

Not applicable

Usage

The GetValue and SetValue methods work only for controls that are associated with business component fields. Therefore, these methods are not applicable to labels. SetValue sets the contents of a control. The user can still change those contents before they are committed to the BusComp field.

SetValue does not validate the format of the data. Data validation occurs at the time user commits the record by stepping off the field/record or saving the record. SetValue can also set the value for a read-only control. However, such value is lost when the record is committed. Also, these methods only work on form applets.

Used With

Browser Script

Example

The following code shows the use of GetValue and SetValue:

function Applet_PreInvokeMethod (name, inputPropSet)
{

switch (name) {

// Example of changing the value of the Abstract control to uppercase
case ("SR Abstract"):
{

var ctlName = "Abstract";
var ctl = this.FindControl(ctlName);
var ctlVal = ctl.GetValue();
ctl.SetValue(ctlVal.toUpperCase());
ctl= null;
return("CancelOperation");

}

// Example of changing the value of a checkbox control
case ("SR Billable"):
{

var ctlName = "Billable Flag";
var ctl = this.FindControl(ctlName);
var ctlVal = ctl.GetValue();
if (ctlVal == "Y")
   ctl.SetValue("N"); // clear the box
else
   ctl.SetValue("Y"); // check the box
ctl= null;
return("CancelOperation");

}

// Example of changing the value of a date/time control
case ("SR Commit time"):
{

var ctlName = "Agent Committed";
var ctl = this.FindControl(ctlName);
ctl.SetValue("12/1/2001 1:09:31 AM");
// format is not validated until user commits the record
ctl= null;
return("CancelOperation");

}

break;

}

}

Siebel Object Interfaces Reference Copyright © 2008, Oracle. All rights reserved.