Hi Everyone,
I have been asked to create a form using Design ES that has element that will only get added by the click of a button. To learn this I created a simple document. Two objects a button to control the object that will get added and the object.
Here is how my file is structured.(if I get some terminology wrong please feel free to correct me)
On my form I have the main subform called "main" then as a child subform of the "main subform called "dyn". I then have the button as an object on the main subform and I have the object (a drop down list) to get added on the "dyn" subform.
What I did so far is put focus on the button and in the scripting window I selected "click" from the "Show" drop down and selected JavaScript for the "Language" drop down. I then added the following syntax.
// Invoke the Instance Manager to add one instance of the dyn subform.
main._dyn.addInstance(1);
I saved my work at this point and went to Preview PDF. When I click the button nothing happens.
Any help on this would be appreciated. I have attached my PDF if it helps.
Thanks
Greg
Solved! Go to Solution.
Views
Replies
Total Likes
On the detail subform you did not allow more than one subform. Click on the detail subform and on the binding tab click the checkbox that says "Repeat Row for Each Data Item".
Are you using Preview to view your form? If so it is setup to create a Print form and your buttons will be disabled. On the Preview Tab in Form Properties set the Preview Type to Interactive.
Paul
Views
Replies
Total Likes
Hi Greg,
Unfortunately your form is queued (a.k.a. caught in the virus scanner) so I can't take a look. What you are witnessing in your form is commonly a result of failing to save the form as a dynamic PDF (at least it is common to me). If the form is not defined and saved as a dynamic PDF, the instance manager or other methods of show/hiding objects will not work.
Which leads me to this...I am not exactly sure of your requirements, but if you simply need to show/hide a dropdown list, using a subform and the instance manager may be overkill. You can change the presence property of the dropdown to make it visible or invisible. The attached sample performs as follows:
When you click the button labelled 'Show Dropdown'....
the dropdown appears and the caption on the button changes to 'Hide Dropdown'. You get a toggle effect.
Steve
Views
Replies
Total Likes
Now that your form is not queued I had a look and Steve was right (you did not make it a dynamic form). This was th e1st problem. Then bu the way you designed it you did not allow more than one instance of the dyn subform. The setting cannot be accessed unless the container subform (in your case - main - is flowed). Once you change it to flowed then you can set the Repeat Subform for each Data Item on the Binding tab. This tells the form that you may have multiple instances.
Paul
Views
Replies
Total Likes
Thanks guys!
One question, how do you make your Form dynamic?
Just so you are aware the form I will be eventually creating will be much more complicated than my one I have provided here. I am just trying a very basic example to understand the process.
Views
Replies
Total Likes
File/SaveAs and choose the dynamic PDF option.
Paul
Views
Replies
Total Likes
Thanks after playing with my original document I wasn't sure what the problem was so I tried to replicate the PurchaseOrder from in the sample files. Obviously I missed some steps as indicated in your previous posts so I worked with this new file to try and solve my problems.
Here is my new file with the corrections of making it a 1. Dynamic form and making the Subform flowed and selecting the check box "Repeat subform for each data item"
Still doesn't work and I am not sure why.
Views
Replies
Total Likes
On the detail subform you did not allow more than one subform. Click on the detail subform and on the binding tab click the checkbox that says "Repeat Row for Each Data Item".
Are you using Preview to view your form? If so it is setup to create a Print form and your buttons will be disabled. On the Preview Tab in Form Properties set the Preview Type to Interactive.
Paul
Views
Replies
Total Likes
Thank you very much!! That did it.
One question though does dynamic elements have to be in a table? The reason I ask is I tried another Form that only had one button and one object that wasn't in a table and I couldn't get it to work.
Views
Replies
Total Likes
No it doesn't have to be in a Table. The table gives you a structure of a flowed container with positioned subforms inside. It is the flowed container that allows the creation of objects. You can create a similar structure on your own by grabbing associated objects and wrapping them in a subform (and setting the type of course).
Paul
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies