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.

Setting current page problem.

Avatar

Level 2

4 Replies

Avatar

Level 2
Hi



I have a number of subforms that span across 30+ pages who's presence is "hidden" I then show them on the click of a button.What's also ment to happen is as I click and show the subforms the pdf's current page must be 1. Its seems to me that when the code executes for xfa.host.currentPage however page 1 doesn't exist because the subforms are still being shown so the pdf's page is not set to the second page. Can anybody help?



Thanks

Avatar

Former Community Member
As you are only showing one page the currentPage is page 1. All other pages are hidden and are not part of the form until they are visible. The product is working as it was intended.



You could put your own page numbers on the form and not rely on a programatic way of resolving pages. As I make page 2 visible then it will say page 2.

Avatar

Level 2
Hi Paul



Thanks for the reply. I only need to set the current page to 1 after all the subforms have been set to visible which is where the problem comes I call currentPage right after setting all the subforms to visible but it doesn't change to the second page.

Avatar

Former Community Member
The pages are still part if the template dom as the objects are created. They are not part of the layout dom as they are marked as hidden. The currentPage looks at the layout dom to set its currentPage.