Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Duplicate pages button does not generate new page

fogharty
Level 2
Level 2

I am almost done with the Form from Heck!

 

I have a page that needs to be duplicated when a button is clicked.

Ideally, when the button is clicked, a copy of the page will be created, placed at the end of the pdf, with new empty fields ready to be filled in.

I used this previous post as a guide and was able to make the button.

 

However, it places the duplicate subform on the same page, and not at the top of a new one.

I'm sure I just have something, somewhere, set incorrectly.

 

The page is a landscape master page (Page2). It is set as Flowed, Allow Page Breaks, Pagination is OnPage "Page2" and Binding is set for Repeat Subform for Each Data Item.

 

There is a subform on this page (CurrentandPending_subform) which contains all the elements I'd like to have on the duplicate page. This includes other subforms and a dynamic table and other elements.

The settings on this subform are: Flowed, Top to Bottom, Allow Page Breaks; Pagination On Page, "Page2"; Binding Repeat Subform for Each Data Item.

 

The script on the button is: _CurrentandPending_subform.addInstance(true);

Is the problem just the script? Can it be tweaked to open a new page?

 

Screenshot 2021-03-04 163158.jpg

 

The table has an "addInstance" to create additional rows, and that's working correctly.

Again, I'm not sure if I'm providing too much detail, or not enough.

I appreciate any help. Thank You

Form Manager
1 Accepted Solution
Magus069
Correct answer by
Level 10
Level 10

Hi there,

 

so after reviewing your form, I managed to make this work.

The (CurrentandPending) page, will have {Pagination > Place} to be set as "Following Previous"

And the top most subform of that page (CurrentandPending_subform), will have {Pagination > Place} to be set as "Top of Page 'Page2'"

 

I hope this will help you.

View solution in original post

6 Replies
Magus069
Level 10
Level 10

Hi there,

 

I have a similar form that has 2 different master pages with landscape and portrait. I just tried out with "Top of Page (Page2)" (Page2 as landscape) and it works just fine...

I could take a look at it real quick if you wish, but it shouldn't be any more than this.

fogharty
Level 2
Level 2
I was getting a blank page when I changed the pagination. I sent you a PM with a link to the latest version. Thanks
Kosta_Prokopiu1
Employee
Employee
Hi, the reason is that simply duplicating the instance uses the same pagination settings in use with the original. Changing those will not help because your original will be affected by that too. Send me your link as well and I see if I find a solution for that - this is comlicated and I have not done this like that before. No promises 🙂
Magus069
Correct answer by
Level 10
Level 10

Hi there,

 

so after reviewing your form, I managed to make this work.

The (CurrentandPending) page, will have {Pagination > Place} to be set as "Following Previous"

And the top most subform of that page (CurrentandPending_subform), will have {Pagination > Place} to be set as "Top of Page 'Page2'"

 

I hope this will help you.

View solution in original post

kautuk_sahni
Community Manager
Community Manager
@Magus069, Thank you for sharing the solution with AEM Community. Keep the wonderful work going. Good to see you back.