Expand my Community achievements bar.

SOLVED

Saving finished Form duplicates some subForms

Avatar

Level 2

I am creating forms that collects data from users and then is submitted to my client.

In these forms there are areas that they can duplicate.

Ex.

Child's Name    blank  

Add More Button (creates a duplicate of Childs Name so they can enter multiple children.

These work fine, however sometimes we have repeatable fields inside repeatable sections.

Ex.

Child's Name    blank {

     Schools Child has attended

     Add More Button (creates another school field)

}
Add More Button (creates anouther Child section

These forms and add more buttons work in livecycle and in Acrobat.

Until you save them or enable usage rights.  Then they suddenly create unexplained duplicates.

It makes no sense to me, but please check for yourself.  The file is attached and the XML code is below that show a simplified form that will reproduce the error.  Copy it to Livecycle and it should recreate our form.  Then open it is acrobat (see it works) and then save a copy.  The copy will have 2 sections.

Please help me figure out what is wrong and how to ix it!  thanks

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

I wouldn't be inclined to copy XML from one form to another. Not saying it can't be done, but it seems dodgy to me.

I did see the error when I opened your form on my PC. Changing the subform name appeared to fix the problem. Rather than copying the XML from one form to another, just try and amend the subform name on your form.

Also I suspect the nice buttons on the top of the page may be an issue. Did you import XML code for these buttons from another application? As they do not appear to be LC style buttons and when I opened your form in LC they disappeared.

If you want to post the form I can try and have a look at it. Either post it online or send a private message to me through the forum.

Niall

View solution in original post

17 Replies

Avatar

Level 10

Hi,

I have seen similar problems with Tables where the header row starts to repeat randomly.

The only thing I saw was that there were two subforms with the same name "Form". Change the higher one to mainForm and amending the add / remove script appears to work.

Try enabling it, seems OK here but I haven't tested it repeatedly.

Good luck,

N.

PS lost your nice buttons on the way... sorry...

Avatar

Level 2

The form you sent me works... but mine doesn't. Out of curiousity are you seeing the error decsribed on your computer?

I even copied your XML into my file and saved that and it STILL messed up.

I am soo confused and frustrated at this.

Anyway, if you could, please take a look and make sure mine does have an error.

I also could send the full form for you to take a look at if you think that may help.

thanks again!!!!

Avatar

Correct answer by
Level 10

Hi,

I wouldn't be inclined to copy XML from one form to another. Not saying it can't be done, but it seems dodgy to me.

I did see the error when I opened your form on my PC. Changing the subform name appeared to fix the problem. Rather than copying the XML from one form to another, just try and amend the subform name on your form.

Also I suspect the nice buttons on the top of the page may be an issue. Did you import XML code for these buttons from another application? As they do not appear to be LC style buttons and when I opened your form in LC they disappeared.

If you want to post the form I can try and have a look at it. Either post it online or send a private message to me through the forum.

Niall

Avatar

Level 2

The buttons are fragments, so I am assuming they go back to default because you don't have my fragment library on your computer.

I did try renaming the sections (as per your suggestion) but it didn't seem to work.  I tried recreating the file you sent to me by doing th eexact same edits, but it still messed up.

I am attaching a dummy version of the initial form for you to see exactly what I am working with.

I am also including a dummy version of the form with the changes you suggested, to show my computer is still crazy.

Also, I am curious, which version of Livecycle are you using.

Really hoping you can help!  Thanks again!

thanks!

Steve

Note:

Funny thing is that the original and the one with edits both act differently when re-saved.  The original has 8 pages and the editted one has 6...

Both should have 3.

Avatar

Level 10

Hi Steve,

I am up to my 7th test on this and trying to iron it out. Basically it is very similar to the issue with randomly repeating headers in Tables. The main problem appears to be the first schedule which DOUBLES the number of subforms every time the file is changed (say on Q35) and then saved and reopened.

I know it not much help restating the problem; but I will have a look over the weekend.

There is a minor amount of duplication in schedule 2, but the main problem appears to be in schedule 1. The first schedule repeats so that each time there is a save and reopen the page numbers go from 3 to 8; 18; 37;... 150...

I am looking at the repeating subforms within repeating subforms to see if we can isolate the instances.

I see the button fragments in the master page of your first form now. That explains that!

I am using LC Designer version 8.2.1.4029... and Acrobat version 9.2.

I'll keep trying,

Niall

Avatar

Level 2

Thanks Niall.  We are still working on it here too.  It is a weird problem. I am curious if it is a bug?

Anyway, I really appreciate your help and will let you know if I figure anything out on my end.

Avatar

Level 2

New Development

Yours works fine on my computer.  So I opened Yours in Livecycle.  Saved it with a new name, opened it in Acrobat, saved it as a different name and....

It duplicated the area.

Could this somehow be my computer?

Try copying all my XML code to a brand new form.  Then test that form.  does it work?

Just an idea.

Thanks again!

Avatar

Level 10

Hi,

Not sure, because I am seeing the same behavour here.

Here is an example of a form from 2007, where we first encountered the problem with repeating Header Rows on re-opening the file.

We solved that problem (with help) and we are trying to apply the same principles with subforms. But it is not straightforward.

Keep in touch,

N.

Avatar

Level 10

Ok,

This is where I have got to (not far!!).

When I inserted a counter into the mainForm subform in the Schedule 1 (in docReady event of first textfield in mainForm: City/...) to count the number of instances it threw up some unusual behavour:

var vNodes = mainForm.instanceIndex;

console.println("vNodes: " + vNodes);

The script prints the number of instances of the mainForm subform and displays this in the javascript console (Control + J). Now this is a zero-based system, so if there is one instance of the subform you would expect to see "vNode: 0".

However when the form is opened in Acrobat there are five instances of the subform and the console shows:

17-10-2009 09-42-22.png

Then when the form is changed; saved; closed; and reopened, the console counts the 14 instances and then still returns the "0", indicating that while there are multiple instances, Acrobat only sees one.

17-10-2009 09-43-31.png

The workaround I was considering was on docReady:

  1. count number of instances;
  2. loop through each instance and test the first textfield for null;
  3. If null then implement script to delete that instance.

This will not work because the last vNode is "0". If it returned the actual number of instances, then we could have done something about it.

I am going to move away from it for a while and see if I can approach it from another direction later.

Niall

Avatar

Level 10

Hi,

The best I have achieved is to "slow" the rate of increase of duplication of the subforms.

I think that there were suborms that were unnecessarily set to flowed. Also I have moved the subforms onto pages (getting desprate).

Also I have got the actual number of instances to display properly. But have run out of steam for a script to delete unnecessary ones.

I feel that this may be a "bug". Can anyone else have a look at this? I feel I am missing something!!

Niall

Avatar

Level 10

Hi,

I have run the form through two of John Brinkman's debugging / checking tools:

http://blogs.adobe.com/formfeed/2009/05/debug_merge_and_layout.html

http://blogs.adobe.com/formfeed/2009/05/document_your_form_template.html

I have tried to work through all warnings and set the form straight.

The best I achieved is that both subforms repeat once when the form is saved / reopened. Schedule 1 is laid out as you had it. I tried to set out schedule 2 as a static subform and then the repeating subform with no minimum count.

A few comments:

  • name your objects as you work through the form, in particular subforms;
  • Only set a subform to flowed when it explicity needs it;
  • Only set object to expand to fit when they need that functionality;
  • Some of the object extended past the containing subform;
  • Check the warnings tab for problems with the target version;

I must get back to the day job, so I will hand over. Sorry I could not get it to work. Good luck and I hope you solve it.

Niall

Avatar

Level 2

Thanks for all the help.  I realized (based on your original fix) that getting rid of the Save/Print Button on the form seems to stop the increase from being expondential, and simply doubles every time.

I also have renamed all the parent 'Forms" and the ButtonAreas to unique names.  This seemed to have fixed the problem.  I am now seeing tables with random repeating rows in other forms I had been working on.

It is quite... interesting.

Thanks for all your input.  I am going to figure out a workaround and see if I can submit this problem to Adobe as a bug.

Avatar

Level 2

Out of curiousity, why are flowed forms so bad.  From a layout perspective they are superior.

Avatar

Level 2

So in the case of this perticular form 2 things were needed to fix it.

1) there was a empty subform used to add space between the print button and the save button on the master page.  It had to be removed.

2) The 'ButtonArea's needed to be unique names.

Now it works.  Still think it is bugs though.  Unless someone else has a better idea why a empty subform would cause so much havoc.

Solved, but don't know all the mechanics of it...

Avatar

Level 10

Hi,

Glad you got it to work!!!

I would only use flowed subforms, where you need that functionality. For example the button subforms were flowed and hence the "spacer" subform to keep the buttons apart. I thought I had deleted all of them.

Flowed forms can work very well, but the more complicated the greater the likelihood of problems and performance issues if the form is very large/long.

Stefan Cameron has a bug list and link to report a bug on his blog.

Good luck,

Niall

Avatar

Level 3

Hi,

I tried using your sample file to add/duplicate subforms in my file but I couldn't get it to work.

I don't know what seems to be the problem.

Could you have a look please?

https://acrobat.com/#d=1QNUD*jtaWssvK2w4RE*ew

I'm trying to get the subform that has 2 image fields to duplicate when 'Add pic' button is clicked.