Expand my Community achievements bar.

Separate Page Counts for individual Subform Pages

Avatar

Level 6

I have two different Master Pages (Page1MP and Page 2MP) which are  assigned to two different Subform Pages within the form (Page1 and  Page2).  I would like to embed two separate page counts for each Subform  Page by placing the counters on the respective Master Pages (if that's the right way to do it).

The issue I've run into is being able to track each page count  "separately" from the total number of pages (page1+Page2). So, for instance, Page1 might start out with  one page when initially rendered, however, it may grow to 7 pages  depending on the amount of user entered data (expanding text boxes, for instance). Thus, I'd want the page  count onall of  Page 1 pages to show x of 7.

Similarly, if Page2 ended up having 30 pages, I'd like it to show a separate count for those pages (i.e. 1 of 30, 2 of 30, 3 of 30, etc).

In the end, I'd like to track TWO individual page counts, not a combined count.

I'm sure there's an easy solution to this question, I just haven't been able to find it.

Thank you in advance for any feedback.

2 Replies

Avatar

Former Community Member

Yep sure is - using xfa.layout.pageSpan

Place the following in the layout:ready event of the fields (listed below) in each of the Master pages

form.FirstSubforminMP2 refers to the first Subform which appears on Master Page 2

MP 1:

currentPageNum:

this.rawValue =  xfa.layout.page(this);

sectionPageCount:

this.rawValue =  (xfa.layout.pageCount() - xfa.layout.pageSpan(form.FirstSubforminMP2));

MP2:

currentPageNum:

this.rawValue =  xfa.layout.page(this) - (xfa.layout.pageCount() - xfa.layout.pageSpan(form.FirstSubforminMP2));

sectionPageCount:

this.rawValue = xfa.layout.pageSpan(form.FirstSubforminMP2);