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?
Views
Replies
Total Likes
Hi,
This looks ok, but how are the thumb rows being added? Maybe it is worth putting some console.println("...") statements after the "if(sec.item(i).thum.rawValue == null)" and see if it is getting past that? If there is only one thumb row then whichever is the first button to click will be the one that works.
Regards
Bruce
Views
Replies
Total Likes
Thanks for your reply.
I am getting browser option to attach image too. I have seen section 1 and 2 are not flowable, but auto hide. All parent subforms are flowable. When I make all flowable all working well. Now I have changed layout, all working well.
Do you think only child subform which is auto hide, withstands 2nd time to visible? Actually I like your idea, stong script. You know this attachment script is yours. I like your blog too.
Thanks for sharing your profound knowledge with us.
Views
Replies
Total Likes