Creating tabs dynamically and attach objects

hi,
I’m generating runtime tabs upon a selection of treeview,
although I am able to manipulate tabs , unable to attach object runtime for each tab. object attached only to last tab, and giving errors when closing tabs.
can you pls support?
my code:
function generate() {
if (mytree1.getAllChecked() != 0) {
var myString = mytree1.getAllChecked();
var mySplitResult = myString.split(",");
for(i = 0; i < mySplitResult.length; i++){
var numi = document.getElementById(‘theValue’);
var num = (document.getElementById(“theValue”).value -1)+ 2;
mytabmid.enableTabCloseButton(true);
mytabmid.addTab(num, mySplitResult[i], “*”);
mytabmid.cells(num).attachObject(“theValue”);
createChart();
mytabmid.setTabActive(num);
}
}
}

Hi,

object attached only to last tab, and giving errors when closing tabs.

Probably you are attaching the same object in all tabs. So, it moves from tab to tab. You can attach html string.