Siebel Advisor API Reference > Siebel Advisor API Examples >
Example of Creating a Custom Input UI Control
The code in the following example defines a graphical radio button input UI control that uses images instead of standard radio buttons to indicate whether the input UI control is selected. As with a radio button, the state of this input UI control changes when users click the radio button image. Some definitions in this example refer to the following:
winObj |
Window that the input UI control is in. |
featureTableName |
Name of the Feature table from which to build the UI control. |
index |
Row of the Feature table you are currently accessing. |
pictOn |
Column name in Feature table which contains path to "selected" image for this row. |
pictOff |
Column name in Feature table which contains path to "unselected" image for this row. |
function BuildImageWidget(winObj,featureTableName,index, pictON, pictOFF)
{
ISS.RegisterUIElement(featureTableName, winObj, true);
var bPict = false;
var srcON, srcOFF;
var label = new ISS.Label_Obj(featureTableName);
if (index >= label.GetNumLabels()) { return ""; }
var srcON = label.GetLabelName(index,pictON);
var srcOFF = label.GetLabelName(index,pictOFF);
var presel = ISS.GetInputValue(featureTableName);
if (presel == null && typeof presel == "undefined") { return ""; }
var src;
if (presel==index) {
src = srcON;
} else {
src = srcOFF;
}
var s = '<A HREF="#" ' ;
s += ' onClick="ISS.SetInputValue(';
s += '\''+featureTableName+'\','+index;
s += ');return false;">';
s += '<IMG align="absmiddle" border = 0 src="'+src+ '"</IMG></a>';
return s;
}
|