Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

how to use xfa.layout.pageCount()

Avatar

Level 2

Hi , I am trying to get the page count for the form i am designing,

by using the following on a text field

this.rawvalue = xfa.layout.pageCount();  --> i am not sure where to use this (on initialize, layout ready etc) ,i used for both of them and i am not getting any value on the form.

my intention is to use this field (with pagecount) to write a formula to show the address if say page count is less than 10 .

can somebody point me to the right direction, thanks in advance

christene

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

the pageCount method doesn't have any input parameters so you don't have to write anything within the bracket.

Use the following JavaScript in the layoutReady event to get the total page count:


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


View solution in original post

3 Replies

Avatar

Level 2

i am getting the current page number by writing

this.rawvalue = xfa.layout.page(this);  - at the layout:ready

but how to get the pagecount..?

Avatar

Correct answer by
Level 10

Hi,

the pageCount method doesn't have any input parameters so you don't have to write anything within the bracket.

Use the following JavaScript in the layoutReady event to get the total page count:


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