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

How to add button to insert duplicate page in form

Avatar

Level 1

Hi All,

I am trying to modify an existing form so that a page can be duplicated by clicking a button. Basically, the form is for a maintenance report and if there are multiple machines being maintained then I would like the user to be able to insert the duplicated pages of the service report required to add the other machines on to the report.

Is this easy to do?

1 Accepted Solution

Avatar

Correct answer by
Level 10

Well, principally this is easy. You'll have to make your form flowed and use at least one repeatable subform.

For example: The form contains a subform 'MyPages' which has a flowed layout and contain one subform 'PageToRepeat' that represents the real page of the form with all the fields etc. This subform has to be set to be repeatable under Binding Tab of the Object palette. A button now can add new instances of 'PageToRepeat' with a short script:

_PageToRepeat.addInstance(true);


1055458_pastedImage_0.png

View solution in original post

6 Replies

Avatar

Correct answer by
Level 10

Well, principally this is easy. You'll have to make your form flowed and use at least one repeatable subform.

For example: The form contains a subform 'MyPages' which has a flowed layout and contain one subform 'PageToRepeat' that represents the real page of the form with all the fields etc. This subform has to be set to be repeatable under Binding Tab of the Object palette. A button now can add new instances of 'PageToRepeat' with a short script:

_PageToRepeat.addInstance(true);


1055458_pastedImage_0.png

Avatar

Level 2
I have followed the instructions here, but it simply puts the "PageToRepeat" on the same page. Is there a way to get it to go onto a new page entirely?

Avatar

Employee

Hi, use the Pagination "Top of next Page" on the PageToRepeat. If that is not set it flows on the same page as in this example the subform fits multiple times.

Avatar

Level 2
I tried that, unfortunately it puts a blank page before the PageToRepeat.

Avatar

Level 10

Hi there,

 

I am not sure exactly how your form looks like, but after testing a few things, seems like the best thing you can do, would be having that repeatable page with content flow setting as "Positioned" and to use the space of the whole page to be able to make it start next page...

Unless you'd be able to make that repeatable page to be included inside the first page a subsequent subform and set the pagination "Top of Page" for that repeatable subform, then it would start on each following page for every instance.

 

Avatar

Level 2

"change the Pagination to "Top of Page" instead..."

 

thank you, but that still produces a blank page.

It may have something to do with my Master pages.

i posted a detailed question in this forum