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
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Creating a table of contents

Avatar

Not applicable
I was wondering if somebody could help with building a table of contents. The page number functionality is present in the library which I drag and drop onto the master page. Now if I could grab that page number value into a text field on the corresponding page that would be very helpful.



Could somebody please provide me with that script.



Thanks,

Dripto
3 Replies

Avatar

Level 10
You shouldl be able to get the page that an object is on by using the xfa.layout.page(Fieldname);

Avatar

Not applicable
Thanks Paul.



I tried your script and failed. Here is the scenario: I have a text field called partOne that resides in a subform called part1 which in turn resides in a subform called rfqDetail.



And in my contents page I created a field to capture the page number and the initialize script that I included in it was:



this.rawValue = xfa.layout.page(rfqDetail.part1.partOne);



However, all I keep getting is a "-1" value in the text field in the contents page. Any ideas as to what I am doing wrong?



Thanks again for your help.