page number generation Dynamically Using SOM Expression in live cycle designer ? | Community
Skip to main content
Level 2
Nov 29, 2022 12:52 PM UTC
Solved

page number generation Dynamically Using SOM Expression in live cycle designer ?

Is there any way to get page number Using SOM Expression in live cycle designer ?

i have tried this on layout:ready*

this.rawValue=xfa.layout.page(xfa.resolveNode("Title[0]").somExpression);

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Vijay_Katoch
Vijay_KatochAccepted solution
New Participant
Nov 30, 2022 10:04 AM UTC

Add the below code to layout ready event:

xfa.layout.page(this);

 

eg: I used below in my form for testing:

form1.Page2.TextField2::ready:layout - (JavaScript, client)

app.alert(xfa.layout.page(this));

 

even working with putting the script on root form node:

form1::ready:layout - (JavaScript, client)

app.alert(xfa.layout.page(Page2.TextField2));

4 replies

Vijay_Katoch
Vijay_KatochAccepted solution
New Participant
Nov 30, 2022 10:04 AM UTC

Add the below code to layout ready event:

xfa.layout.page(this);

 

eg: I used below in my form for testing:

form1.Page2.TextField2::ready:layout - (JavaScript, client)

app.alert(xfa.layout.page(this));

 

even working with putting the script on root form node:

form1::ready:layout - (JavaScript, client)

app.alert(xfa.layout.page(Page2.TextField2));

Translate
radzmar
Level 10
Dec 6, 2022 9:35 PM UTC

Don't do that, you might get trapped in an endless loop of alert windows and crash the PDF viewer or Designer then, since the layout ready event can execute very very often depending on the forms build quality. Use the JavaScript console instead.

 

form1::ready:layout - (JavaScript, client)
console.println(xfa.layout.page(Page2.TextField2));
Translate
Mayank_Gandhi
Employee
Nov 29, 2022 3:49 PM UTC

@bhanu2 total page no. of pdf or the page no. in which the component is?

Translate
bhanu2Author
Level 2
Nov 30, 2022 4:21 AM UTC

Thank you @mayank_gandhi for you responce.

i am expecting the page no. in which the component is.

Translate