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

Bizarre! removeInstance removes wrong page, adds multiples other page

devrag
Registered: May 12 2010
Posts: 32

I have a bizarre problem.

In Designer 8.2, I am dealing with a dynamic form with four different pages . Each page is a complete subform. Page1 and Page2 are initially the only pages. Page1 has a button to add a continuation page of Page3. Each Page3 has a button to add additional instances of Page3, with item numbering increasing with each subsequent page. Likewise, Page4 is the continuation page for Page2.

Page3 and Page4 each have "Repeat subform for each data item" checked, with no initial and no minimum value. So the form first appears in Preview with only Page1 and Page2.

On each instance of Page3 and Page4, there is a delete button to delete that specific page. When I add multiple instances of Page3 and Page4, then try to delete one of the earliest pages, it is always the most recently added instance which is deleted. My delete button click code is:

_Page4.removeInstance(this.parent.index);
xfa.form.remerge();

What is even more baffling is that when I delete any Page4, it adds a random number (in the 3-5 range) of instances of Page3! It also deletes the most recently added Page4.

I put a messageBox within the add button routine of Page3, and these instances are not going through that button routine. All four pages are defined as Positioned and Visible.

Help, please!

Devra

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

the handling of body pages is very difficult and causes alot of problems, especially when ading/removing instances of them.

I suggest to use only one body page in a form, that is much easier to handle!

So the form hierachie will look like:
form1pageSetmasterpagebodypage (flowing/allow page breaks)mainsubform (flowing/allow page breaks)subform1 (any settings)text fields, buttons, drop down boxes etc ...subform2 (any settings)text fields, buttons, drop down boxes etc ...subform3 (any settings)text fields, buttons, drop down boxes etc ......

I have an example form I designed for another topic, but will also match this one.
[url]http://thelivecycle.blogspot.com/2010/04/xfa-form-control-view-settings.php[/url]

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

devrag
Registered: May 12 2010
Posts: 32
Thank you for responding so fast. I just did some reading on body pages, so made the following changes:

Previous setup:

topmostSubform (flowed by definition)
(Master Pages)
PageArea1
ContentArea1
Page1
Page2
Page3
Page4


New Setup:

topmostSubform (flowed by definition)
(Master Pages)
PageArea1
ContentArea1
BodyPage (flowed)
Page1 (Positioned)
Page2 (Positioned)
Page3 (Positioned)
Page4 (Positioned)

The addInstance still works fine, and all the continuation pages are added correctly.

But now when I delete Page4, it still deletes the wrong one, it deletes all the Page 3's, and worse yet, I get about 20 Page1's. Help!