- Mark as New
- Follow
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report
I think both of your problems are solvable.
Problem 1:
There are two possible solutions you can attempt to address this problem. One is the way you are currently trying, which is by putting the fields in the Master Page. I personally don't recommend this, because putting anything but static text or images can get fishy...especially when you start trying to run JavaScript. MasterPage objects don't behave well, because the MasterPage is technically just designed for a look and feel type of functionality. This is what I've been told at least.
The other possible solution, and what I would try to do, is use the Overflow Leader functionality. An Overflow Leader is basically a header that repeats before a repeatable object starts again on the next page. So say I have a subform called "Attendee" that can be repeated potentially infinite times. When I build my form I'll have my "Header" subform, then my repeatable "Attendee" subform. If I click on "Attendee" and go to the Object pallette, Navigation tab, there is an option for "Overflow Leader". The drop-down should have a list of all the other subforms in the form. Pick "Header." Now every time "Attendee" repeats onto another page, it will be preceded by a copy of "Header."
Now, we still have the issue of keeping the data consistent across all of the text fields (either in the Master Page or Overflow Leader). For each object check the Object pallette, Binding tab. For binding it probably says "None" or "Normal." Change this to "Global." What this will do is create a new rule for the form: whenever an object has the name X (the name of the object), persist the data. Now when you have multiple of the same object on more than one page, it will persist the data. If you have to data bind this field to an XSD schema, that should suffice as well. You wouldn't have to use Global binding.
Problem 2:
This sort of ties into Problem 1. Let's say for your "Table of Contents" page you have a subform called "Chapter" that contains a few text boxes. "Chapter" is the subform that you are going to allow to repeat every time the user clicks an "Add" button. You need to do a few things to accomplish this. First, wrap "Chapter" in another subform, we'll call "ChapterContainer". For "ChapterContainer" go to the Object pallette, Subform tab. Select Content: Flowed. This will wrap the subform tightly around "Chapter," but will allow it to expand as you add more instances of "Chapter."
Next, for "Chapter" go to the Object pallette, Binding tab. Check the option that says "Repeat Subform for Each Data Item." This allows "Chapter" to repeat withing "Chapters". There are some options that are now usable about the intial number of instances, the maximum allowed (say you want to limit the user to 50 chapters instead of infinite), and the minimum (say you want it to be at least 5). Now your "Chapter" subform is set up to repeat across pages. There are some options you can play with on the Object Pallette, Pagination tab as well, but I won't explain them here.
Now if you need to add a button to add more instances, drop a button on the form. Click on it and open the script editor. Select the "Click" event from the dropdown. Change the language to "JavaScript" (or convert this to FormCalc if that's what you're using), and enter one line of script:
ChapterContainer.Chapter.instanceManager.addInstance();
Conversely, you can create a remove button with the following script:
ChapterContainer.Chapter.instanceManager.removeInstance();
What you are trying to do is exactly what dynamic PDFs are designed for, so you should be able to get it to work with some playing around. I hope this helps get you started!
Ryan D. Lunka
Cardinal Solutions Group
rlunka@cardinalsolutions.com