Exclude hidden pages from autonumbering

Avatar

Avatar

Kais_Khelif_179

Avatar

Kais_Khelif_179

Kais_Khelif_179

27-09-2016

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar

mouslander

Avatar

mouslander

mouslander

03-10-2016

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

Answers (8)

Answers (8)

Avatar

Avatar

mouslander

Avatar

mouslander

mouslander

03-10-2016

Glad it worked out for you!

Avatar

Avatar

Kais_Khelif_179

Avatar

Kais_Khelif_179

Kais_Khelif_179

03-10-2016

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.

Avatar

Avatar

Kais_Khelif_179

Avatar

Kais_Khelif_179

Kais_Khelif_179

03-10-2016

I  put it on the form initialization.

Avatar

Avatar

mouslander

Avatar

mouslander

mouslander

03-10-2016

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

Avatar

Avatar

Kais_Khelif_179

Avatar

Kais_Khelif_179

Kais_Khelif_179

03-10-2016

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

Avatar

Avatar

mouslander

Avatar

mouslander

mouslander

03-10-2016

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

Avatar

Kais_Khelif_179

Avatar

Kais_Khelif_179

Kais_Khelif_179

30-09-2016

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

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372

Avatar

_Bruce_Robertson

MVP

Total Posts

1.8K

Likes

268

Correct Answer

372
_Bruce_Robertson
MVP

29-09-2016

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