Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Get current master page number in formcalc/Javascript

Avatar

Avatar
Validate 1
Level 1
Ashok1
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Ashok1
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Ashok1
Level 1

28-05-2020

I have two master pages in my Adobeform and i need to get the current master page number to assign that value to the field in subform of bodypage.

i have tried below things to get current master page number and total count of current master page but it is giving page numbers including all the master pages.

$layout.page ( ref ( $ ) )--->giving current page number(including all master pages)

$layout.pageCount()--> total page count(including all master pages)

Kindly provide the logic to get the current master page number and count.

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile

Avatar
Coach
MVP
radzmar
MVP

Likes

395 likes

Total Posts

2,686 posts

Correct Reply

491 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
MVP

29-05-2020

Hi, 

 

so I guess you're trying to get the n-th instance of a master page used as background of a specific form page? In that case you'll need a combination of several scripting methods to find out. 

Given you have a field somewhere in the form, to display the current index the script looks this way: 

 

this.rawValue = xfa.layout.pageContent( xfa.layout.absPage(this).toString(), "pageArea", true).item(0).index + 1;

 

How it works:

Determine the 0-based-page number of the field with xfa.layout.absPage(this) and convert it to a string with toString(). Then get a node list of page areas used for that page with xfa.layout.pageContent( …, "pageArea", true). Now select the first item of that node list by item(0) and return it's 0-based index number and add 1.

 

Simple, isn't it?! 😉

 

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
Ashok1
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile

Avatar
Validate 1
Level 1
Ashok1
Level 1

Likes

0 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
View profile
Ashok1
Level 1

01-06-2020

kindly help me to get the current master count(total number of current master page)