Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Extend Features in Adobe Reader

Avatar

Level 3

Hello,


I'm working on a form that has several dropdown lists fields wrapped individually into hidden subforms which become available (visible) once their assigned check boxes are selected. After testing the form, all works just fine. However, the issue I'm running into is actually coming up only after I Extend Features in Adobe Reader. The issue has to do with the dropdown items, in which I'm using a for loop to display my list of items
very much in the same way as the "Purchase Order" form that comes with Adobe LiveCycle. The problem is that before extending the features in Adobe Reader, the dropdown list shows all my items populated in my for loop just as planned, however, once I extend the feature in Reader, all the list items appear twice i.e. item1, item2, item3, then, item1, item2, item3 again as if it "shadows" all the items.

When I noticed the issued in my form, I thought I had done something wrong, but after double checking I confirmed that the issued only occurred on the extended file and not on the original file. So, I decided to test it on the "Purchase Order" form by "Extending Features in Adobe Reader" and and the same thing occurred to the "Part No." items. You can check it out for yourselves!!

I'd appreciate any help you can give me to solve this issue.

Thank you!!

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

If you look here you will see that some events "appear" to fire twice when the form is enabled: Event fired twice

I suspect that you have the script in an event like docReady or initialize.

You could move the script to the preOpen event of the dropdown. This fires just as the user is opening the dropdown.

Another possible solution would be to include the following line at the very top of your populating script for the dropdown:

this.clearItems(); 

This would clear the list when the event fires the second time in the Reader Enabled form and then just populate it again once.

Good luck,

Niall

View solution in original post

5 Replies

Avatar

Correct answer by
Level 10

Hi,

If you look here you will see that some events "appear" to fire twice when the form is enabled: Event fired twice

I suspect that you have the script in an event like docReady or initialize.

You could move the script to the preOpen event of the dropdown. This fires just as the user is opening the dropdown.

Another possible solution would be to include the following line at the very top of your populating script for the dropdown:

this.clearItems(); 

This would clear the list when the event fires the second time in the Reader Enabled form and then just populate it again once.

Good luck,

Niall

Avatar

Level 3

Niall,

I actually have my script in the "change" event, and it reads "FruitsScript.getFood(xfa.event.newText, LabelSheets".

I moved it to the "preOpen" event and not only the event keeps firing twice, but I also don't get the second array to display anymore. (LabelSheets).

This is sort of what I have in my actual form. It is a table that expanded in which header 1 would be my items, and header 2 would display the value assigned in the second array.

Header 1Header 2
Dropdown List (keeps Firing Twice)"LabelSheets" (does not display value)


Thank you for your help, I really appreciate it!!!!!!

Avatar

Level 3

I forgot to mention. if I use the "this.clearItems();"  script; once I select one item from the dropdown list, it freezes it and I cannot open the list anymore.

Thank you!!!

Avatar

Level 3

Niall,

I spoke too soon. I changed my script to the preOpen event and now it creates a “shadow” list for every time I select an item on the list. So, the first time the list shows the original items, then, if I choose a different item, the list now displays twice as many, and then, if I choose a different item, then the list fires another set of items, and it keeps on growing….

I really appreciate your help!!!

Avatar

Level 3

Niall,

Please disregard the last two messages. The script "this.clearItems();" totally resolved the problem I was having with my form.

Thanks a LOT!!!!!