Expand my Community achievements bar.

SOLVED

Exclude hidden pages from autonumbering

Avatar

Level 2

Hi there,

I have a form that spans around 10 pages and 6 of them are hidden so based on selection some of the pages will show. I have a page counter that is always displaying all the 10 pages. Like  Page 1 of 10 even though there are only 4 pages displayed. How can I get the correct count based on what's shown to the user.

Thanks

1 Accepted Solution

Avatar

Correct answer by
Level 7

do a test:

Create a new form

Add 2 pages to it

On the master page insert the page n of m from the custom library

From the Object tab hide one of the 3 pages then preview in PDF

View solution in original post

9 Replies

Avatar

Level 10

Are you using the standard "Page n of m" control, this should allow for hidden pages as it uses xfa.layout.page(this) to get the page of the current object in the layout dom and xfa.layout.pageCount() which gets the total pages.

Regards

Bruce

Avatar

Level 2

Bruce,

I am using "Page n of m" control and it still displays the total numbers of pages which are 1 of 10 and 2 of 10 and 3 of 10 even though I am only showing the 3 pages. (I only want it to show the number of pages showing like 1 of 3 and 2 of 3 and 3 0f 3 and not take the other ones into the count.).

I forgot to mention that we are using AEM and the pages are displaying as HTML5 and I am seeing some odd behavior that was working in regular forms and now they are acting differently like for example xfa.host.messageBox (Acts differently on a HTML form than regular xdp.

Thanks

Avatar

Level 7

How are you setting up your numbering. I just ran a test where I created 3 pages and hid the 2nd page. I get 1 of 2 and 2 of 2. When I unhide the page I get 1 of 3 etc.

Did you put the page numbering on the master page? Are you hiding the page or making it invisible?

Avatar

Level 2

I put the page numbering on the Master Page (page # of ##) and using the .presence = "hidden" on Initialization of the form.

Avatar

Level 7

where did you put .presence="hidden".  you do not need to do that.

Avatar

Level 2

I  put it on the form initialization.

Avatar

Correct answer by
Level 7

do a test:

Create a new form

Add 2 pages to it

On the master page insert the page n of m from the custom library

From the Object tab hide one of the 3 pages then preview in PDF

Avatar

Level 2

Here is what I was doing wrong.

I was only hiding the pages through presence = "hidden" and the object was still visible so it was still counting the pages. I did what you told me and it worked. Thanks for your direction.