I have a dct like this
[html]
[/html]
and I am trying to have an id for the container(text or attachment)
[html]
var item=IWDatacapture.getItem('/page/IMAGES/images/image').getChildren();
if (item) {
for (var i=0; i newSponImage(item
);
}
}
function newSponImage(newitem){
var iwItems = newitem.getChildren();
var d = new Date();
var pr_id = d.getTime();
if (iwItems.length > 0) {
var containerName = iwItems[0].getName();
if (containerName.indexOf("/text") > 0) {
IWDatacapture.getItem(containerName+'/@id').setValue(pr_id);
}
if (containerName.indexOf("/attachment") > 0) {
alert(containerName);
IWDatacapture.getItem(containerName+'/@id').setValue(pr_id);
}
}
IWDatacapture.redraw();
}
[/html]
I have many form elemts inside text and attachement containers...I have removed them for simplicity
but this gives me an error saying
IWDatacapture.getItem(containerName+'/@id').setValue(pr_id);
is null or not an object...can anyone tell me whats wrong with this?
[html]
I am expecting the id ike this
some other elements here
----------
some other elements here
-----------
[/html]