We are creating a copy to all functionality for DCTs with four separate state tabs. The code parses the first tab and then passes the values to the matching fields on the state tab selected in a checkbox.
If a replicant does not exist on the selected tab it is created. Everything works except for nested replicants. The browser window locks up and I start getting busy script messages. There should be no looping at the point that this occurs and single replicants work fine.
Code below. copytargetStateandreplicant is the replicant we are checking for on the target tab.
var copytargetStateandreplicant = IWDatacapture.getItem(fullTargetPath);
if(null == copytargetStateandreplicant){
alert("NULL = "+fullTargetPath+" SET = "+partTargetPath+" "+childStringIndex);
copytargetStateandreplicant = IWDatacapture.getItem(partTargetPath);
alert("copytargetStateandreplicant = "+copytargetStateandreplicant);
copytargetStateandreplicant.addInstance(childStringIndex);
}
Content of above alerts before the lock up:
NULL = /state/New Mexico/nm/tab[1]/accordian[2] SET = /state/New Mexico/nm/tab[1]/accordian 2
copytargetStateandreplicant = [IWItem andreplicantcontainer /state/New Mexico/nm/tab[1]/accordian]
The alerts above from a working addInstance with a single replicant:
NULL = /state/New Mexico/nm/tab[3] SET = /state/New Mexico/nm/tab 3
copytargetStateandreplicant = [IWItem andreplicantcontainer /state/New Mexico/nm/tab]
Attaching the js and the DCT.