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

addInstance and subform help

emerlin
Registered: Jul 21 2008
Posts: 33

Hi,

I have a sheet setup with 4 subforms representing one aspect of a project. Subform #3 contains an addInstance item that setup and working perfectly. It basically adds rows for users to add more data. For my project I may need multiple occurrences of this aspect in the project, so I wrapped the four subforms into one and used a new addInstance button to repeat parent.

That works fine, I can repeat the subform over and over, but when I use the addInstance button (on subform #3) it will only add it to the initial instance and not the one I am working in.

for example -
Parent 1
Parent 2
Parent 3 - addinstance on subform3 adds instances (rows) to parent #1 - ugh. In fact, not matter what the parent sheet it only grows #1.

This is the code used in the third subform:
HTItems.instanceManager.addInstance();

Any help? Thanks E

My Product Information:
LiveCycle Designer
ttianna
Registered: Oct 13 2009
Posts: 3
Did you get a solution to this problem? I am having the same problem.
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Interesting, I haven't done nested repeating subforms before. But I tried it using different variations and did not see this problem at all.

I've uploaded my test file to Acrobat.com. The subforms have colored outlines so you can see what's what:
https://share.acrobat.com/adc/document.do?docid=11645d78-f94b-4b0b-86d4-862c0e61fb3f

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

rushtons
Registered: May 13 2010
Posts: 13
I was having this problem too and you seem to have solved it. My particular issue lies with the nesting and not referencing the 'parent'.

Thanks!