I am using same script under two subform section 1 and section 2. When click on button under section1, this script is working well, but section 2 not working.
Again if I click on the button section 2, it is working well, but section 1 not working then. Each section withstand other section. I have seen presence action get corrupted.
var sec = xfa.resolveNodes("images.thumb[*]");
outer:
for(var i=0; i<sec.length; i++)
{
if(sec.item(i).thum.rawValue == null)
{
if (event.target.importDataObject("name"))
{
var attachmentObject = event.target.getDataObject("name");
var filetype = attachmentObject.path.substring(attachmentObject.path.lastIndexOf("." ) + 1);
if (filetype === "jpg" || filetype === "JPEG" || filetype === "png" || filetype === "bmp" || filetype === "JPG")
{
var imageStream = event.target.getDataObjectContents("name");
var imageStreamEncoded = Net.streamEncode(imageStream, "base64");
sec.item(i).presence = "visible";
sec.item(i).thum.rawValue = util.stringFromStream(imageStreamEncoded);
break;
}
else {app.alert("Please insert correct format image");}
}
else { break outer;} //if cancel
}
}
What should I do now?