Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.
SOLVED

Repeating Header and Button Problems

Avatar

Level 2

I've been finding myself digging deeper and deeper into Livecycle lately, as our office is trying to convert ALL forms to pdf. This has been somewhat of a headache for me.

I finally figured out how to make text automatically flow to the next page a week or so ago (to my GREAT releif). So now I'm on to the next confusing problem.

I need to have a header repeat from page to page, along with data the user enters into the feilds. I tried to accomplish this by putting the feilds I wanted repeated onto a Master Page. That certainly makes them repeat like I wanted--but the data entered doesn't seem to carry over from page to page. How do I make this happen?

My second problem I have run into is this--I have a table of contents page that I need to essentially "duplicate" as needed. For instance, they run out of spaces and need more, so they click the button to add another page to the table of contents--all the other pages shifting down from there. This is a rather important thing for this form to do, as later I will be adding more pages that need to do the same thing. It would be great if I could accomplish this (with minimal programming), since it would cut down our 21 separate forms into one--getting rid of the need to keep track of page numbers ourselves, and reducing the amount of data that has to be re-entered.

I appreciate any help!! I have also attached what I have so far to help along any suggestions.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Glad the first problem is solved.  You can actually apply the same principle to make an entire page repeat.  If you repeatable subform is the size of the entire page, every time it repeats a new page will be created.

As for why it's not working, my guess is that you are not working with a Dynamic PDF.  There are three types of files you can deal with in Designer: a Static PDF, a Dynamic PDF, and an XDP (XML Data Package).  Dynamic PDF is what you want, so when you save your file, make sure it is as this type.  You also have to turn on dynamic functionality in the Form Properties. 

Go to File > Form Properties.  In the "Defaults" tab, set PDF Render Format to "Dynamic XML Form."  In the "Preview" tab, set Preview Type to "Interactive Form" and Preview Adobe XML Form As to "Dynamic XML Form."  This will allow the form to render as a dynamic PDF while in Preview PDF mode.  This is a common thing to have to deal with.

Try some of that, hope it helps.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

View solution in original post

15 Replies

Avatar

Former Community Member

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

Avatar

Level 2

Thanks so much for your help! I did get my first problem fixed by looking over what you said. To get my values to carry over onto all the pages, I simply set the binding on those two feilds to "Global." I would have gone the more involved way had there been any calculations to be done with the values, but these are simply displayed; there are no calculations to be done on them, so I didn't see a problem doing it the more simplistic way.

As for my second problem... well, that's been a headache. I've been working on it off and on all morning and simply cannot get it to work. I followed the above instructions and made a subform within a subform to make the button add them when clicked. The button doesn't seem to work at all; it doesn't do anything. At one point I did get extra pieces BELOW my button, dissappearing off the page. I'm guess I need to set my main page subform to "Flowed" but everytime I do this it completely messes up the layout of everything.

I tried to take out the extra pieces so that only those in my subforms were on the page, and move the button higher, but then every time I click "Save" the program freezes up and it mangles my file so I have to completely redo the changes. Apparently it really doesn't like that button being up any higher or something.

Provided I do get this working, it still doesn't help if I need to duplicate an entire page rather than just a few lines. Unless I can use the same method?

I went ahead and attached one of the mangled copies in case someone wants to try messing with it.

Any suggestions?

Avatar

Correct answer by
Former Community Member

Glad the first problem is solved.  You can actually apply the same principle to make an entire page repeat.  If you repeatable subform is the size of the entire page, every time it repeats a new page will be created.

As for why it's not working, my guess is that you are not working with a Dynamic PDF.  There are three types of files you can deal with in Designer: a Static PDF, a Dynamic PDF, and an XDP (XML Data Package).  Dynamic PDF is what you want, so when you save your file, make sure it is as this type.  You also have to turn on dynamic functionality in the Form Properties. 

Go to File > Form Properties.  In the "Defaults" tab, set PDF Render Format to "Dynamic XML Form."  In the "Preview" tab, set Preview Type to "Interactive Form" and Preview Adobe XML Form As to "Dynamic XML Form."  This will allow the form to render as a dynamic PDF while in Preview PDF mode.  This is a common thing to have to deal with.

Try some of that, hope it helps.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

Avatar

Level 2

I've been quite careful to make certain I was saving them in the proper format. I went ahead and checked what you suggested, though, and my settings were as you said to put them. I went back step-by-step to try and get the file to save with the button placement--for some reason this time it magically didn't lock up. Maybe it was the order I was doing the changes in? I don't know.

Anyway, now I have several sets in a stack at the top of the page. Which is okay, except that when I click the button to add more, it doesn't do anything. I went ahead and set the main page subform to "Flowed" Then to keep the page number at the bottom, I put it in its own subform--which works, except that when it scrolls it pushes the page number onto the next page instead of simply moving it down and keeping it on that page. And I'm not sure if it's possible to get page numbers working with the Master Page--so far all of my experiements to do so have not worked.

It's good to know that it will work for full pages--if I can just get it working to begin with! : )

So... I'm a little farther than I was. Certainly a learning experience! Thanks for all the help so far--I wouldn't even be as far as I am now without it. Attached is my mess.

Avatar

Former Community Member

You're getting close...Just play around with some of the pagination settings and overflow settings and stuff like that.  You're definitely trying something that Dynamic PDFs are designed specifically to do.  As far as the page number is concerned, definitely put that in the Master Page.  It works there.  There's actually even a custom object that you have by default in LiveCycle Designer for page number.  You can drop that in the Master Page and then you'll have page numbers.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

Avatar

Level 2

Yes! Finally! I got it working! I was right, in that I had to have the main page "Flowed" before it would work. So I moved everything to the innermost subform before setting it, so that way my layout wouldn't be messed up and voila!

Now the only problem is that my "Remove" button won't work... I can add as many pages as I need, but I can't remove any if I accidently click too many times. Is there a current instance I need to pass to make it work?

Avatar

Former Community Member

Oh yea, my bad.  You're right.  I gave you the wrong JavaScript.  You do need to pass in an instance index for removeInstance().  It'll look something like:

// Count the number of chapters (the repeatable subform)

var nChapters = ChapterContainer.Chapter.instanceManager.count()

// Remove the last instance in the list.  Because indexes start at 0 it will be one less than the count.

ChapterContainer.Chapter.instanceManager.removeInstance(nChapters-1);

You may want to double check that.  I typed it out in the forum and not in Designer, so it may not be 100% right.  I think it is though.  This should do it for you.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

Avatar

Level 2

Thanks again! I also found that Chaptercontainer.chapter.instanceManager.removeInstance(this.parent.index) works.

Now I'm just trying to figure out if I can hide the button on the first page. Not that it's completely necessary. Thanks again!

Avatar

Level 2

Alright, I'm going back to my first problem of a repeating header again. I am working on another form, and found that my Master Pages trick doesn't work for this one like it did the last, so I came back here to see that other method that had been suggested. Quoted from that post:

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."

This would be great for me to try, except on them Object pallette I don't see a Navigation tab ANYWHERE. The only tabs I have under Object are Subform, Pagination, and Binding. I've looked through my other pallettes and don't see a Navigation tab either. Any other suggestions on where to find this option? I am using Livecycle Designer 8.0

Avatar

Former Community Member

I didn't realize you were using 8.0. I actually have limited experience with 8.0, so I couldn't tell you one way or the other whether or not that functionality is available in that version. It sounds like it may not be. I would try to get in touch with someone at Adobe either through this forum or other means to find out. The information is probably available in LiveDocs as well.

Ryan D. Lunka

Cardinal Solutions Group

rlunka@cardinalsolutions.com

Avatar

Level 2

I see the Pagination tab and all of the different options there that look like they could in fact solve my problem... but I'm not certain I understand the different options and how they work.

Avatar

Former Community Member

I do not believe that those options have changed between 8 and 9.

There are three things that you need to set. If the page overflows where do you want the overflow to go. This allows you to choose a different Master Page or a different Content Area (useful if you were dealing with columner data - like a newspaper). Now when th epage overflows do you want to lay down a Header or trailer. These options allow you to pick a subform that represents these components. You can only pick one subform for your trailer of header. Note that this technique is very different than the Master Page technique you used in the 1st example.

Hope that helps

Paul

Avatar

Level 2

That was a definite help. I selected the entire page subform and went to the Pagination Tab. On "Overflow Leader" I selected the name of the subform I wanted to repeat. This worked perfectly! BUT... only when my content ran onto the second page. That is, my original was on the first page like I wanted, and it automatically appeared on the second page as my content flowed. However, when my content scrolled to the point of having three pages; on the third page there was no more header.

Avatar

Level 2

Ah! Replying to myself, because I figured a way around it.

Since I couldn't seem to get the subform to wrap the way I wanted, I did the following:

1) I took the subform I wanted to repeat and put it on the master page.

2) On the master page, I resized the content area so that it would begin UNDERNEATH the subform I wanted to be repeated.

This solved my problem.

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----