I can't get my case to work with my choicebox. It does not fall inside the case that has the value selected. I am defaulting my value to "=". It always falls thru in the "LIKE" value which is the last one. I tried selectItem, setItem and setValue.
//Clients Dropdown.
choiceboxClients.clear();
Console.clear();
//Dropdown selection for the SQL criteria.
choiceboxTSQL.addItem("=");
choiceboxTSQL.addItem("IN");
choiceboxTSQL.addItem("LIKE");
choiceboxTSQL.setValue("=");
//choiceboxTSQL.selectItem(0);
//choiceboxTSQL.setItem(0);
switch (choiceboxTSQL.getSelectedIndex())
{
case 0: //"=":
// Lopp thru the array to put single quotes around the values.
for (var n in TempArr)
{
ParamVal = ParamVal + "'" + TempArr[n] + "',";
}
ParamVal = ParamVal.substring(1,ParamVal.length-1);
strWhere = " Where " + WhereFld + " = " + ParamVal;
//break;
case 1: //"IN":
// Lopp thru the array to put single quotes around the values.
for (var n in TempArr)
{
ParamVal = ParamVal + "'" + TempArr[n] + "',";
}
ParamVal = ParamVal.substring(1,ParamVal.length-1);
strWhere = " Where " + WhereFld + " IN(" + ParamVal + ")";
//break;
case 2: //"LIKE":
strWhere = " Where " + WhereFld + " LIKE '%" + ParamVal + "%'";
//break;
}