These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Problem with addInstance

madfox
Registered: Feb 13 2009
Posts: 8
Answered

Hello

I am quiet new to the LiveCycle Designer. I've created simple form just to check, how instanceManager.addInstance(1) method works. Nonetheless, when I press Add button or remove button nothing happens to the layout of my form. Still, I know that subforms are added (removed) by checking whether they exist with xfa.form.resolveNode methods.

Here are my codes for buttons adding and removing subforms:

//Adding subform
xfa.form.form1.Page1.Container.Added.instanceManager.addInstance(1);

if( xfa.form.resolveNode("form1.Page1.Container.Added[3]") ){
xfa.host.messageBox("3rd exists");
}

//Removing subform
this.parent.instanceManager.removeInstance(this.parent.index);

if( !xfa.form.resolveNode("form1.Page1.Container.Added[3]") )
{
xfa.host.messageBox("3rd does not exist");
}

the form can be found here: http://www.megaupload.com/?d=75D3IQSD

Any ideas of what can be wrong?

---------------------------
System Configuration
Operating system: Windows XP
Application: LiveCycle Designer Version 7.0

xrum
Registered: Feb 25 2009
Posts: 124
did you save your form as dynamic? did you change the biding of your subform to allow multiple instances?


-----
Edit: Just looked at your form. Save it as Dynamic and it'll work. feel free to post if it does not.
madfox
Registered: Feb 13 2009
Posts: 8
Hello xrum.

Yes, the error was very simple. I saved it as a static PDF. Thank you for your help