Duplicate pages button does not generate new page | Community
Skip to main content
March 5, 2021
Solved

Duplicate pages button does not generate new page

  • March 5, 2021
  • 2 replies
  • 2146 views

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?

 

 

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

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Magus069

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.

2 replies

Magus069
March 5, 2021

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.

March 8, 2021
I was getting a blank page when I changed the pagination. I sent you a PM with a link to the latest version. Thanks
Magus069
Magus069Accepted solution
March 9, 2021

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.

kautuk_sahni
Community Manager
Community Manager
March 11, 2021
@magus069, Thank you for sharing the solution with AEM Community. Keep the wonderful work going. Good to see you back.
Kautuk Sahni