Kirix Support Forums

case with choicebox

Please post any help questions, requests or other feedback here.

case with choicebox

Postby abenitez77 on Thu May 17, 2012 12:49 pm

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;
}
abenitez77
Registered User
 
Posts: 143
Joined: Fri Jan 21, 2011 12:42 pm

Return to Strata Help & Feedback