I’m trying to populate a select list in a DCT using the callServer method. I’m calling a Perlscript that calls a Java program that queries the DB and returns an array of options called newOptions. The select item I’m populating is a replicant so I’m looping through the replicants and setting each replicant select list using api.IWDatacapture.getItem("/itemB[" + i + "]/item").setOptions(newOptions); ("api" is the variable I’m using to reference parent.getScriptFrame()

The contents of the newOptions array is dependent on the value of another item in the DCT, Item A. The value of Item A gets passed to the Java code and returns an appropriate array of options. This also works perfectly well.
Here’s the callServer Javascript:
function loadItemBList (){
var ItemA = IWDatacapture.getItem("/ItemA");
if (ItemA.isValid()){
var params = new Object();
var ItemAOptions = ItemA.getOptions();
var ItemAIndex = ItemA.getValue();
params.ItemA = ItemAOptions[ItemAIndex].value;
IWDatacapture.callServer("/iw-bin/getItemBList.cgi", params, true);
}
}
This code works fine, runs the CGI and returns the newOptions array.
When the DCT first loads I’m running javascript that sets all the replicant select lists in Item B to the contents of the newOptions array and it works perfectly. No matter how many replicants, it works flawlessly.
Here’s how I’m setting the replicant list to newOptions array content:
for (var i=1; i<replicant.length; i++) {
api.IWDatacapture.getItem("/ItemB[" + i + "]/item").setOptions(newOptions);
api.IWDatacapture.redraw();
}
The problem occurs once the DCT has loaded. When a user changes the value of Item A, the select lists in all the Item B replicants need to change accordingly. So I have an event handler on Item A:
IWEventRegistry.addItemHandler("/ItemA", "onItemChange", loadItemBList);
This also works. In Netscape 7, changing Item A runs loadItemBList and replaces the contents of the selects for each replicant in Item B with the newOptions array content. No problem. Ran the Netscape Javascript debugger, no problems.
However, in IE 6, when there is more than one Item B replicant to change I get an error when changing Item A.
So, if I hard code one item in the javascript it works great in IE 6:
api.IWDatacapture.getItem("/itemB[4]/item").setOptions(newOptions);
If I hard code two calls, it fails in IE:
api.IWDatacapture.getItem("/itemB[3]/item").setOptions(newOptions);
api.IWDatacapture.getItem("/itemB[4]/item").setOptions(newOptions);
If I try looping in IE 6 it fails:
for (var i=1; i<replicant.length; i++) {
api.IWDatacapture.getItem("/itemB[" + i + "]/item").setOptions(newOptions);
api.IWDatacapture.redraw();
}
I can see that the update runs for the first of the replicants and changes the values. However when it hits the second it throws this error:
“Object does not support this method or property”
The IE Javascript debugger refers to line 711 of Javascript in Teamsite’s /iw/webdesk/templating/dcapi_item.js :
for ( i = 0; i < options.length; i++ ) {
selectElement.options
= options;
}
This problem is driving me crazy. I can’t see any reason it’s not working in IE 6. Please help me.