Defaulting value in different column than selected one

Hi

I have 2 different combo boxes in one grid. Making a selection in combobox 1, I need to populate combobox 2 in the same row with a specific value. Here is how I setup my combo boxes in the grid:

CapItemCombo = CapitalItems.getColumnCombo(0);

CapItemCombo.enableFilteringMode(true, "pagevrd.vrd?session=2weik5db4dv4xqjlm9ues7x1ftcacagv&objectOid=&page=cejQuoteEntry&formAction=getProductCode", true, true);
CapITemDescCombo = CapitalItems.getColumnCombo(1);
CapITemDescCombo.enableFilteringMode(true, "pagevrd.vrd?session=2weik5db4dv4xqjlm9ues7x1ftcacagv&objectOid=&page=cejQuoteEntry&formAction=getProductDesc", true, true);

On this combobox I have an event added which fires off this function when a one of the above comboboxes is changed:

function caOnCellEdit(stage,rowId,cellInd){
if (stage==2&&(cellInd==0||cellInd==1)){
		var co = CapitalItems.cells(rowId,cellInd);
		var url = "pagevrd.vrd?    session=2weik5db4dv4xqjlm9ues7x1ftcacagv&objectOid=&page=cejQuoteEntry&formAction=getProductInfo" + "&cellInd=" + cellInd + "&getValue=" + co.getValue();
		fireAjaxMethodSync(url, 
			function(xmlHttp) {
				if (cellInd==0){
					var coNew = CapitalItems.cells(rowId,cellInd + 1);
				}
				if (cellInd==1){
					var coNew = CapitalItems.cells(rowId,cellInd - 1);
				}

				if (cellInd==0||cellInd==1){
				coNew.setCValue(xmlHttp.responseText, "<option value="+xmlHttp.responseText+">"+xmlHttp.responseText+"</option>");
					coNew.wasChanged=true;
				}
			}
		);
        }
}

This does work by setting the correct text on the other combobox using setCValue, but when tabbing off the first combobox the value of the second combo gets lost. It does not keep the value as it was set by setCValue. I also tried setCTxtValue but with no difference.
Also coNew.wasChanged=true doesn’t make any difference.

Please excuse the indenting of the code :slight_smile:.
Thanks for any help regarding this.

You need to add the option to the combo list with addOption() method.